Parcourir la source

add: 新功能文档

joe il y a 4 ans
Parent
commit
e5f181eba4
4 fichiers modifiés avec 217 ajouts et 0 suppressions
  1. 1 0
      .gitignore
  2. 121 0
      docs/activities_mine.md
  3. 29 0
      docs/board.md
  4. 66 0
      docs/messages.md

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+.idea/

+ 121 - 0
docs/activities_mine.md

@@ -0,0 +1,121 @@
+# 黑洞星活动
+
+## 全局新增接口
+GET api/user/notifications
+
+returns
+```json
+{
+    "unread": 3,                // 未读消息条数
+    "mining": {
+        "symbol": "doge",           // 当前 coin
+        "icon":  "http://a.png",    // coin icon
+        "price": 2.07,              // 单价(RMB)
+        "progress": 12.00123,       // 进度, 0 表示 stopped
+        "total": 208                // 已获得总数
+    },
+    "carousel": {
+      "interval": 3,
+      "items": [{
+                   "text": "<span style=\"color:2343;\"></span>",
+                   "uri": "page/boards",
+                }]      // 跑马灯
+    } 
+}
+```
+
+客户端自行调用,可定时或切页面调用,相当于服务器推送
+
+## 
+
+1. 启动
+
+> 启动后不支持手动停止
+
+POST api/coin/boot
+
+returns
+```json
+{
+  
+}
+```
+
+2. 历史记录
+
+GET api/coin/history?page=1&limit=30
+
+returns
+```json
+{
+  "history": [{
+               "symbol": "doge",
+               "icon": "http://a.png",
+               "amount": 12.00034,
+               "ts": 1235345435,
+               "from": "abcde034345dd",
+               "to": "aabde2343df34",
+               "income": 1     // 获得. 数字前应显示 + 号, 
+                               // 当 =0 时显示 - 号,表示是一条提币记录
+                               // "from" 为空, "to" 为用户设置的导出地址
+               },{
+             
+             }]
+}
+```
+
+3. 更新提币地址
+
+POST api/coin/addr
+
+params
+```json
+{
+  "symbol": "doge",
+  "addr": "aaabbbcccddd3343"
+}
+```
+
+returns
+```json
+{
+
+}
+```
+
+4. 导出/提币
+
+POST api/coin/transfer
+
+params
+```json
+{
+  "symbol": "doge",
+  "amount": 100
+}
+```
+
+returns
+```json
+{
+
+}
+```
+
+5. 钱包
+
+钱包协议增加字段
+
+```json
+{
+"coins": [
+    {
+        "symbol": "doge",
+        "icon": "http://a.png",
+        "total": 123.43,
+        "addr": "1243434345"
+    }
+]
+}
+
+```

+ 29 - 0
docs/board.md

@@ -0,0 +1,29 @@
+# 排行榜协议
+
+## 获取排行榜
+
+GET api/boards?type=1
+
+params
+
+- 1 日榜单
+- 2 周榜单
+
+> 暂不支持全部榜单
+>
+returns
+```json
+{
+  "daily": [{
+    "uid": 12343,   // 不使用
+    "nickname": "fdsf",
+    "avatar": "http://fdsf.png",
+    "border": 1,    // 头像框, 暂不使用 
+    "level": 1,     // crmeb 中等级
+    "vip": 0,       // 是否是 vip, 暂不使用
+    "value": 102.14 // 上榜数据
+  }],
+  "weekly": [{  // 当请求周榜单为 weekly 
+  }]
+}
+```

+ 66 - 0
docs/messages.md

@@ -0,0 +1,66 @@
+# 消息协议
+
+总体协议格式
+```json
+{
+  "status": 200,
+  "msg": "ok",
+  "data": {
+  }
+}
+```
+
+协议定义只描述 data 部分
+
+## 消息列表
+
+GET api/user/messages?page=1&limit=30
+
+returns
+```json
+{
+  "messages": [{
+    "id": 1,
+    "icon": "",       // 为空时使用默认图标
+    "from": "fdjf",   // 消息发送者
+    "subject": "df",  // 标题  考虑支持 html 
+    "body": "fsdfd",  // 内容, 考虑支持 html 
+    "ts": 123434545,  
+    "expiresAt": 1234354545, // 过期时间
+    "type": 0,    // 0 系统消息, 1 群组系统消息(比如针对会员) 2 个人
+    "read": 0
+  }]
+}
+```
+
+## 已读/未读
+
+POST api/user/messages
+
+params
+```json
+{
+  "ids": [1,2],    // 空列表表示全部
+  "read": 1   // 允许为 0, 非0认为是1
+}
+```
+
+returns
+```json
+{
+
+}
+```
+
+## 删除
+
+DELETE api/user/messages
+POST api/user/messages/del
+
+params
+```json
+{
+  "ids": [1,2]   // 空列表表示全部
+}
+```
+