- 1.2.1 读取应用列表,1.2.2 读取我创建的应用, 1.2.3 读取我收藏的应用, 1.2.6 读取某个应用 增加
recommendTimes,degreeOfHeat字段 - 1.2.10 读取某个应用的运行结果 增加
nextCursor返回以支持分页 - 新增接口 1.2.11 读取某个运行结果
- 新增接口 1.3.6 批量读取我对应用的点赞状态
- 新增文档 1.9 用户
- 新增接口 1.9.3 读取用户个人统计
- 新增接口 1.2.4 读取某用户的应用
- 新增接口 1.3.10 批量读取我对应用的推荐状态
- 新增接口 1.3.11 对应用进行推荐/取消推荐
- 新增接口文档 1.11 系统配置,对各种 key 进行描述,增加运营位相关 key
- 新增接口 1.11 系统配置,对各种 key 进行描述,增加运营位相关 key
- 新增接口 1.9.5 管理后台小程序置顶 (需要管理权限)
- 新增接口 1.9.6 管理后台置顶小程序排序 (需要管理权限)
- 新增接口 1.9.7 管理后台读取小程序列表
[[TOC]]
| 环境 | 域名 |
|---|---|
| 开发环境 | ai.moyu.dev.openviewtech.com |
| 测试环境 | ai.moyu.test.openviewtech.com |
| 生产环境 | ai.moyu.chat |
对于 HTTP 状态码,有
| 状态码 | 说明 |
|---|---|
| 200 | OK |
| 400 | 客户端异常 (参数错误等) |
| 500 | 服务端异常 |
| 401 | 鉴权异常 |
对于每个 HTTP 请求,都会有以下格式的应答
| 字段 | 说明 |
|---|---|
| code | 业务状态码,0 代表正常 |
| msg | 消息描述,进一步描述具体的 code,若 code 为 0,不携带此字段 |
| data | 响应数据,格式为 Json,若 code 不为 0 或者无需返回业务数据,不携带此字段 |
-
例如
// HTTP/1.1 200 OK res = { "code": 0, "data": { id: "xxx", name: "xxx" } };
或
// HTTP/1.1 401 UNAUTHORIZED res = { "code": 401, "msg": "invalid token" };
- 鉴权信息放在Cookie中,采用 HttpOnly(前端不用关心,js也无法读取)
- 请求头中 需要携带 csrf-token,防止 跨站攻击,csrf-token在登录时生成:
GET / HTTP/1.1
X-CSRF-TOKEN: {csrf-token}为了方便问题排查时的链路追踪,需在每个请求的 Request Header 携带以下字段
GET / HTTP/1.1
X-Request-ID: {id}并且会随着响应头原样返回;注意:若不携带此字段,服务端将自动生成一个
- 字段
| 字段 | 说明 |
|---|---|
| id | 全局唯一的 id,唯一标识一个请求,可以是 UUID |
-
例子
-
请求
GET /xxx HTTP/1.1 X-Request-ID: 123, X-CSRF-TOKEN: {csrf-token}
-
应答
// HTTP/1.1 200 OK // X-Request-ID: 123 httpRes = { "code": 0, "data": { //... } }
-
- 开发环境:ai.moyu.dev.openviewtech.com
- 测试环境:ai.moyu.test.openviewtech.com
- 生产环境:ai.moyu.chat
复用摸鱼接口
按照热度排序
-
请求
GET /api/apps?category=1 HTTP/1.1
-
其中
字段 说明 category 应用类型ID,非必传 -
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "list": [ { "id": 1, "uuid": "uuid", "name": "模板名称", "price": 5, //花费积分 "soldPoints": 100, "description": "模板描述", "results": [ { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" }, { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" } ], "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" }, "runTimes": 12, "useTimes": 11, "recommendTimes": 2345, "degreeOfHeat": 325, "commentTimes": 10, "likeTimes": 2, "createdAt": "2023-03-22T07:08:02.851Z", "updatedAt": "2023-03-22T07:08:02.851Z", "status": 0 // 生命周期 (0.未发布 1.已发布) } ] } };
按照创建时间倒序
-
请求
GET /api/apps/mine HTTP/1.1
-
其中
字段 说明 category 应用类型ID -
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "list": [ { "id": 1, "uuid": "uuid", "name": "模板名称", "price": 5, //花费积分 "soldPoints": 100, "description": "模板描述", "results": [ { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" }, { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" } ], "createdAt": "2023-03-22T07:08:02.851Z", "updatedAt": "2023-03-22T07:08:02.851Z", "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" }, "runTimes": 12, "recommendTimes": 2345, "degreeOfHeat": 325, "useTimes": 11, "commentTimes": 10, "likeTimes": 2, "status": 0 // 生命周期 (0.未发布 1.已发布) } ] } };
按照收藏时间倒序
-
请求
GET /api/apps/collected HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "list": [ { "id": 1, "uuid": "uuid", "name": "模板名称", "price": 5, //花费积分 "soldPoints": 100, "description": "模板描述", "results": [ { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" }, { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" } ], "createdAt": "2023-03-22T07:08:02.851Z", "updatedAt": "2023-03-22T07:08:02.851Z", "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" }, "runTimes": 12, "useTimes": 11, "recommendTimes": 2345, "degreeOfHeat": 325, "commentTimes": 10, "likeTimes": 2, "status": 0 // 生命周期 (0.未发布 1.已发布) } ] } };
按照创建时间倒序
-
请求
GET /api/users/:userId/apps HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "nextCursor": "xxx", "list": [ { "id": 1, "uuid": "uuid", "name": "模板名称", "price": 5, //花费积分 "soldPoints": 100, "description": "模板描述", "results": [ { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" }, { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" } ], "createdAt": "2023-03-22T07:08:02.851Z", "updatedAt": "2023-03-22T07:08:02.851Z", "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" }, "runTimes": 12, "useTimes": 11, "recommendTimes": 2345, "degreeOfHeat": 325, "commentTimes": 10, "likeTimes": 2, "status": 0 // 生命周期 (0.未发布 1.已发布) } ] } };
-
请求
POST /api/apps/:uuid/collect HTTP/1.1 { "collected": true }
-
其中
字段 说明 uuid APP uuid -
应答
// HTTP/1.1 200 OK res = { "code": 0 };
-
请求
POST /api/apps/is-collected HTTP/1.1 { "uuids": ["app1","app2","app3"] }
-
其中
字段 说明 uuids APP uuid -
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "app1": true, "app2": false, "app3": true } };
结果中会包含参数给出的所有 uuid
-
请求
GET /api/apps/:uuid HTTP/1.1
-
其中
字段 说明 uuid APP uuid -
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "id": 1, "uuid": "uuid", "price": 5, //花费积分 "soldPoints": 100, "name": "模板名称", "category": 1, "description": "模板描述", "form": [ { "id": "uuid", "label": "姓名", "type": "text", "properties": { "placeholder": "xxx" } }, { "id": "uuid", "label": "性别", "type": "select", "properties": { "placeholder": "xxx", "values": "男\n女", } } ], "flow": [ { "id": "uuid", "type": "chatgpt", "outputVisible": true, "prompt": [ { "type": "text", "properties": { "value": "从" } }, { "type": "tag", "properties": { "character": "uuid", "from": "result/form" } }, { "type": "text", "properties": { "value": "选出最好的结果" } }, ] } ], "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" }, "runTimes": 12, "useTimes": 11, "commentTimes": 10, "likeTimes": 2, "recommendTimes": 2345, "degreeOfHeat": 325, "createdAt": "2023-03-22T07:08:02.851Z", "updatedAt": "2023-03-22T07:08:02.851Z", "status": 0 // 生命周期 (0.未发布 1.已发布) } };
-
请求
PUT /api/apps/:uuid HTTP/1.1 { "name": "模板名称", "duplicateFrom": "uuid", //若从某个模板复制,此字段为源模板 uuid ,否则不传。此字段只有第一次保存生效,后续的修改无效 "category": 1, "description": "模板描述", "form": [ { "id": "uuid", "label": "姓名", "type": "text", "properties": { "placeholder": "xxx" } }, { "id": "uuid", "label": "性别", "type": "select", "properties": { "placeholder": "xxx", "values": "男\n女" } } ], "flow": [ { "type": "chatgpt", "outputVisible": true, "prompt": [ { "id": "uuid", "type": "text", "properties": { "value": "从" } }, { "id": "uuid", "type": "tag", "properties": { "from": "result", //form 或者 result "character": "uuid" } }, { "id": "uuid", "type": "text", "properties": { "value": "选出最好的结果" } }, ] } ], "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" }, "createdAt": "2023-03-22T07:08:02.851Z", "updatedAt": "2023-03-22T07:08:02.851Z", "status": 0 // 状态 (0.未发布 1.已发布) }
-
其中
字段 说明 uuid 应用 UUID 如果是创建模板,则由前端生成一个 -
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "id": 1, "uuid": "uuid", "name": "模板名称", "category": 1, "description": "模板描述", "form": [ { "id": "uuid", "label": "姓名", "type": "text", "properties": { "placeholder": "xxx" } }, { "id": "uuid", "label": "性别", "type": "select", "properties": { "placeholder": "xxx", "values": "男\n女", } } ], "flow": [ { "id": "uuid", "type": "chatgpt", "outputVisible": true, "prompt": [ { "type": "text", "properties": { "value": "从" } }, { "type": "tag", "properties": { "charactor": "uuid" "from": "result/form" } }, { "type": "text", "properties": { "value": "选出最好的结果" } }, ] } ], "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" }, "runTimes": 12, "useTimes": 11, "commentTimes": 10, "likeTimes": 2, "createdAt": "2023-03-22T07:08:02.851Z", "updatedAt": "2023-03-22T07:08:02.851Z", "status": 0 // 生命周期 (0.未发布 1.已发布) } };
只能删除自己的应用
-
请求
DELETE /api/apps/:uuid HTTP/1.1
-
其中
字段 说明 uuid 应用 UUID 如果是创建模板,则由前端生成一个 -
应答
// HTTP/1.1 200 OK res = { "code": 0 }
-
请求
POST /api/apps/:uuid/run HTTP/1.1 Accept: text/event-stream Content-Type: application/json;charset=utf-8 { "values": ["text参数","男"], "open": true }
-
其中
字段 说明 uuid app uuid values 表单参数,按顺序传递,均传递字符串 open 是否开放运行结果 -
应答
HTTP/1.1 200 OK Content-Type: text/event-stream event: data data: {"flow":"uuid","type":"text","content":"这"} event: data data: {"flow":"uuid","type":"text","content":"是"} event: data data: {"flow":"uuid","type":"text","content":"数"} event: data data: {"flow":"uuid","type":"text","content":"据"} event: done data: {"code":0}
-
说明
数据成组出现,每组数据流由
event和data两种结构组成, 并用换行分割, 每组数据用两个换行(\n\n)进行分割
| 消息 | 说明 |
|---|---|
| event | 消息头,描述事件类型。若为 data 则表示数据,若为 done则表示结束 |
| data | 消息载荷,若 event 为 data,则携带数据,若 event 为 done 则携带结束状态,与 http 业务响应体含义一致 |
-
对于
data的特别说明事件流的数据结构与普通
output实体结构一致,但content变为分片数据,其中flow为逻辑流的id当数据来自不同的逻辑流时,flow字段用于区分 -
可能的业务
codecode 说明 500000 积分余额不足
按照最新排序分页返回,一页50条记录
-
请求
GET /api/apps/:uuid/outputs?size=xxxcursor=xxx HTTP/1.1
-
其中
字段 说明 uuid 应用ID cursor 分页游标 size 分页大小,选填 -
应答
// HTTP/1.1 200 OK resp = { "code": 0, "data": { "nextCursor": "xxxxx", "total": 2, "list": [ { "id": "1", "type": "text", "inputArgs":["xxx","xxx"], "inputForm":[ { "id": "uuid", "label": "姓名", "type": "text", "properties": { "placeholder": "xxx" } }, { "id": "uuid", "label": "性别", "type": "select", "properties": { "placeholder": "xxx", "values": "男\n女", } } ], "content": "哈哈哈", "likeTimes": 12, //点赞数 "hateTimes": 12, //踩数 "commentTimes": 12, //评论数 "createdAt": "xxxx", "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" } } ] } }
-
请求
GET /api/outputs/:outputId HTTP/1.1
-
其中
字段 说明 outputId 运行结果ID -
应答
// HTTP/1.1 200 OK resp = { "code": 0, "data": { "id": "1", "type": "text", "inputArgs":["xxx","xxx"], "inputForm":[ { "id": "uuid", "label": "姓名", "type": "text", "properties": { "placeholder": "xxx" } }, { "id": "uuid", "label": "性别", "type": "select", "properties": { "placeholder": "xxx", "values": "男\n女", } } ], "content": "哈哈哈", "likeTimes": 12, //点赞数 "hateTimes": 12, //踩数 "commentTimes": 12, //评论数 "createdAt": "xxxx", "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" } } }
按照热度排序
-
请求
GET /api/ai-models HTTP/1.1
-
应答
// HTTP/1.1 200 OK resp = { "code": 0, "data": { "list": [ { "category": "语言类模型", "models": [ { "id": 1, "name": "chatgpt", "description": "ChatGPT", "icon":"https://xxx/xx", "available": true } ] } ] } }
-
请求
GET /api/app-categories HTTP/1.1
-
应答
// HTTP/1.1 200 OK resp = { "code": 0, "data": { "list": [ { "id": 1, "text": "文学" }, { "id": 2, "text": "文学" } ] } }
-
请求
GET /api/app-tabs HTTP/1.1
-
应答
resp = { "code": 0, "data": { "tabs": [ { "label": "热门", "category": 0, "order": 0 }, { "label": "生活", "category": 1, "order": 1 }, { "label": "文学", "category": 2, "order": 2 }, { "label": "办公神器", "category": 3, "order": 3 } ] } }
前端上报事件
-
请求
POST /api/events HTTP/1.1 { "type": "event-type" "args": ["args"] }
-
应答
resp = { "code": 0 }
-
注意
调用此接口可以不登录
- 事件类型参考 2. 事件定义
-
请求
POST /api/apps/:uuid/comments HTTP/1.1 { "content": "xxx" }
-
应答
resp = { "code": 0 }
-
请求
POST /api/outputs/:id/comments HTTP/1.1 { "content": "xxx" }
-
应答
resp = { "code": 0 }
-
请求
POST /api/apps/:uuid/like HTTP/1.1 { "like": true }
-
其中
字段 说明 like 点赞/取消点赞 -
应答
resp = { "code": 0 }
-
请求
POST /api/outputs/:id/like HTTP/1.1 { "like": 1 }
-
其中
字段 说明 like 1. 顶, 0. 取消点赞 -1. 踩 -
应答
resp = { "code": 0 }
-
请求
GET /api/apps/:id/like HTTP/1.1
-
其中
字段 说明 like 点赞/取消点赞 -
应答
resp = { "code": 0, "data": { "like": true, } }
-
请求
POST /api/apps/is-liked HTTP/1.1 { "appIds": ["xxx"] }
-
应答
resp = { "code": 0, "data": { "app1": true, "app2": true, "app3": false, } }
输入参数均会出现在应答中
-
请求
GET /api/apps/:uuid/comments HTTP/1.1
-
应答
resp = { "code": 0, "data": { "list": [ { "id": 12, "content": "评论", "createdAt": "2023-03-22T07:08:02.851Z", "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" } } ] } }
-
请求
GET /api/outputs/likes?outputIds=xxx,xxx,xxx HTTP/1.1
-
其中
字段 说明 outputIds 输出ID -
应答
resp = { "code": 0, "data": { "list": [ { "outputId": "12", "like": 1 }, { "outputId": "12", "like": 0 } ] } }
-
请求
GET /api/outputs/:id/comments HTTP/1.1
-
应答
resp = { "code": 0, "data": { "list": [ { "id": 12, "content": "评论", "createdAt": "2023-03-22T07:08:02.851Z", "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" } } ] } }
-
请求
POST /api/apps/is-recommended HTTP/1.1 { "appIds": ["xxx"] }
-
应答
resp = { "code": 0, "data": { "app1": true, "app2": true, "app3": false, } }
输入参数均会出现在应答中
-
请求
POST /api/apps/:id/recommend HTTP/1.1 { "recommend": true }
-
其中
字段 说明 recommend 是否推荐 -
应答
resp = { "code": 0 }
-
请求
GET /api/users/me/guidance HTTP/1.1
-
应答
resp = { "code": 0, "data": { "completed": true } }
-
请求
POST /api/users/me/guidance/completion HTTP/1.1
-
应答
resp = { "code": 0 }
-
请求
GET /api/points?page=xxx&size=xxx HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "total": 100, //结果总数 "list": [ { "userId": 31, // 用户ID "points": 100, // 积分数 "description": "空投奖励", // 描述 "createdAt": "2022-09-22T11:11:27+08:00" } ] } };
查询用户当前积分总数
-
请求
GET /api/points/total HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { total: 200, //积分总数 withdrawAmount: 2, //可提现金额 (元) } };
-
请求
GET /api/points-goods HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "list": [ { "id": 12, "price": 9.9, "points": 300, "tag": "" }, { "id": 13, "price": 0.99, "points": 50, "tag": "new-deal" } ] }, };
-
其中
对于 tag 标识了商品的特殊属性,前端可以根据约定的 tag 标识做多种表现方式
| TAG | 说明| | new-deal | 新人特惠,首次充值才可以使用|
-
请求
GET /api/points-orders/exists HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "exists": true }, };
-
请求
GET /api/points-orders HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "list": [ { "orderId": "7F50C7E74F884F94B72D348B1BF9492C", "goods": { "id": 1, "price": 0.01, "tag": "", "points": 50, "description": "测试" }, "goodsId": 1, "price": 0.01, "userId": 10058, "createdAt": "2023-04-26T10:51:58.3775153+08:00", "state": 0, "codeUrl": "weixin://wxpay/bizpayurl?pr=8MOQXJ2zz", "PayExpiresAt": "2023-04-26T12:51:58.3775153+08:00", "payedAt": null } ] } };
生成积分充值订单,并检查权限,阻止不满足条件的下单
-
请求
POST /api/points-goods/:goodsId/points-orders HTTP/1.1
-
其中
字段 说明 goodsId 充值档位商品ID -
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "orderId": "7F50C7E74F884F94B72D348B1BF9492C", "goods": { "id": 1, "price": 0.01, "tag": "", "points": 50, "description": "测试" }, "goodsId": 1, "price": 0.01, "userId": 10058, "createdAt": "2023-04-26T10:51:58.3775153+08:00", "state": 0, "codeUrl": "weixin://wxpay/bizpayurl?pr=8MOQXJ2zz", "PayExpiresAt": "2023-04-26T12:51:58.3775153+08:00", "payedAt": null } }
-
可能返回的状态码
状态码 说明 403010 非新人禁止使用新人档充值
-
请求
GET /api/points-orders/:orderId HTTP/1.1
-
其中
字段 说明 orderId 充值订单ID -
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "orderId": "7F50C7E74F884F94B72D348B1BF9492C", "goods": { "id": 1, "price": 0.01, "tag": "", "points": 50, "description": "测试" }, "goodsId": 1, "price": 0.01, "userId": 10058, "createdAt": "2023-04-26T10:51:58.3775153+08:00", "state": 0, "codeUrl": "weixin://wxpay/bizpayurl?pr=8MOQXJ2zz", "PayExpiresAt": "2023-04-26T12:51:58.3775153+08:00", "payedAt": null } }
-
Data 为空表示订单不存在
积分申请提现
-
请求
POST /api/points-withdraw HTTP/1.1 { "points": 2000 }
-
应答
// HTTP/1.1 200 OK res = { "code": 0 };
-
可能返回的状态码
状态码 说明 500010 积分余额未达到提现标准 500000 积分余额不足 -
触发事件
积分流水变化提醒
-
请求
GET /api/notify-messages?isRead=true&cursor=xxx HTTP/1.1
-
其中
| 字段 | 说明 |
|---|---|
| isRead | 筛选未读消息,非必填, 若传递,按照指定状态筛选,若不传递,不筛选 |
| cursor | 分页游标,来源于上一页的 data 数据, 不填返首页数据 |
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "nextCursor": "xxxx", //下一页的游标 "list": [ { "id": 21, "icon": "https//xxx/xxx", "title": "空投奖励", "content": "嗨新伙伴,欢迎加入我们!送你 30 积分,和我们开始创造吧!", "isRead": false, "createdAt": "2023-03-22T07:08:02.851Z" }, { "id": 21, "title": "好友邀请", "icon": "https//xxx/xxx", "content": "邀请用户(老用户):哇塞!邀请好友成功,恭喜您获得 100 积分", "isRead": true, "createdAt": "2023-03-22T07:08:02.851Z" } ] } };
-
请求
GET /api/notify-messages/unread-count HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "count": 12 } };
-
请求
PUT /api/notify-messages/:id/read HTTP/1.1
-
其中
| 字段 | 说明 |
|---|---|
| id | 消息ID |
-
应答
// HTTP/1.1 200 OK res = { "code": 0 };
-
请求
PUT /api/notify-messages/read-all HTTP/1.1
-
其中
| 字段 | 说明 |
|---|---|
| id | 消息ID |
-
应答
// HTTP/1.1 200 OK res = { "code": 0 };
-
请求
GET /api/sign-in HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "signIn": false } };
-
请求
POST /api/sign-in HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0 };
-
请求
GET /api/retain-messages HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "list": [ { "id": "xxx", "type": "friends-first-login", //邀请好友(合并消息) "payload": { "points": 80, "friends": [ { "id": 21, "nickname": "xx", "avatar": "xx" } , { "id": 22, "nickname": "xx", "avatar": "xx" } ] } } ] } };
复制自摸鱼
-
请求
GET /api/users/me/info HTTP/1.1
-
应答
//HTTP/1.1 200 OK { "code": 0, "data": { "id": 0, "nickname": "哈哈哈哈哈", "avatar": "https://openview-oss.oss-cn-chengdu.aliyuncs.com/aed-test/avatar/93.png", "lastLoginAt": "xxxxx" //为空表示首次登录 "invitedBy": 23, //为空表示自然流量 "points": 80 } }
复制自摸鱼
昵称长度:八个汉字
-
请求
PUT /api/users/me/info HTTP/1.1 { nickname: "xxxx", avatar:"https://sxxx" }
-
应答
//HTTP/1.1 200 OK resp = { "code": 0 }
-
请求
GET /api/users/:userId/statistic HTTP/1.1
-
应答
//HTTP/1.1 200 OK resp = { "code": 0, "data": { "apps": 390, "registeredDays": 30, "points": 30, "appUses": 30999, "appLikes": 30999, } }
复制自摸鱼
- 请求
POST /api/users/logout HTTP/1.1
- 应答
// SET-Cookie: token=xxxx httpStatus = 200; httpRes = { code: 0 };
-
请求
PUT /admin-api/apps/:appId/top HTTP/1.1 { "top": false }
-
应答
httpRes = { "code": 0 };
如小程序未置顶则忽略
-
请求
PUT /admin-api/apps/top-sorting HTTP/1.1 { "appIds":["xxx1","xxx2","xxx3"] }
-
其中
字段 说明 appIds 排序后的置顶 小程序的 uuid 序列 -
应答
httpRes = { "code": 0 };
按照热度排序
-
请求
GET /admin-api/apps?category=1 HTTP/1.1
-
其中
字段 说明 category 应用类型ID,非必传 -
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { "list": [ { "id": 1, "uuid": "uuid", "name": "模板名称", "price": 5, //花费积分 "soldPoints": 100, "description": "模板描述", "results": [ { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" }, { "id": 1, "type": "text", "content": "xxxxxxxxxxxxxxxxxxx" } ], "createdBy": { "id": 12, "nickname": "xxxx", "avatar": "http://xxx/xxx" }, "viewTimes": 12, "runTimes": 12, "useTimes": 11, "recommendTimes": 2345, "degreeOfHeat": 325, "commentTimes": 10, "likeTimes": 2, "createdAt": "2023-03-22T07:08:02.851Z", "updatedAt": "2023-03-22T07:08:02.851Z", "status": 0 // 生命周期 (0.未发布 1.已发布) } ] } };
按照热度排序
-
请求
POST /api/system/js-sdk-signature HTTP/1.1 { "url": "xxx" }
-
应答
// HTTP/1.1 200 OK res = { "code": 0, "data": { } };
通知接收类的服务端消息推送,采用 Websocket 的方式实现
wss://ai.moyu.dev.openviewtech.com/push/endpoint?scrf=-
其中
字段 说明 scrf CSRF Token
事件定义见 3. 服务端推送事件定义
-
格式
{ "type": "xxx", "args": [] } -
其中
字段 说明 type 事件类型 args 参数
具体的类型有如下定义
{
"type": "app-viewed",
"args": ["uuid"]
}-
其中
字段 类型 说明 args[0] 字符串 App uuid
-
请求
GET /api/system-configs?key=xxx HTTP/1.1
-
应答
// HTTP/1.1 200 OK res = { code: 0, data: { value: xxx }, };
-
其中
字段 说明 value 值,可以是任何数据类型
根据不同的 key,存在以下对应的 value
-
MINI_APP_AD_PLACEHOLDER_HOME
首页运营位
{ "thumbnail": "https:///xxx/xxx", "target": { "url": "https://xxx/xxx", "type": "image" } } -
其中
字段 说明 thumbnail 图片内容 target.url 目标URL target.type 目标类型 (image: 图片, link: 链接) -
MINI_APP_AD_PLACEHOLDER_OUTPUT
应用输出详情运营位
{ "thumbnail": "https:///xxx/xxx", "target": { "url": "https://xxx/xxx", "type": "image" } } -
其中
字段 说明 thumbnail 图片内容 target.url 目标URL target.type 目标类型 (image: 图片, link: 链接)
{
"type": "share-hint-create-app",
"payload": {
"createdApps": 1, // 创建小程序数量
"earnPoints": 12 // 获得积分
}
} {
"type": "share-hint-use-app",
"payload": {
"usedApps": 3, // 使用小程序数量
"costPoints": 12 // 花费积分
}
}{
"type": "notify-message-changed",
"payload": {
"unread": 10
}
} {
"type": "retain-message-changed"
} {
"type": "user-points-changed"
}