消息接口
Notification 对象
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | 消息id |
| title | string | 标题 |
| content | string | 内容 |
| notification_type | number | 消息类型,1系统消息,2推广消息 |
| position | string | 消息位置, POPUP弹窗, CENTER消息中心 |
| readed | bool | 是否已读 |
| sended_at | string | 发送时间 |
获取消息列表
URL: GET /notification/list?page=1
Query:
| 字段 | 必填 | 说明 |
|---|---|---|
| page | 否 | 页码,从1开始 |
| size | 否 | 每页大小 |
| search | 否 | 搜索关键词 |
| notification_type | 否 | 消息类型,1系统消息,2推广消息 |
| readed | 否 | 是否已读 |
输出: list<Notification>
获取最新弹窗消息列表
返回最新5条,取第1条显示即可
URL: GET /notification/popup_list
Query: 无
输出: list<Notification>
获取未读消息数量
URL: GET /notification/unread_count
Query: 无
输出:
| 字段 | 类型 | 说明 |
|---|---|---|
| count | number | 未读数量 |
读消息
URL: POST /notification/read
输入:
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ids | list<string> | 否 | 消息id列表,和all二选一 |
| all | bool | 否 | 是否把所有消息都设置为已读 |
输出: 无
删除消息
URL: POST /notification/deletes
输入:
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ids | list<string> | 否 | 消息id列表,和all二选一 |
| all | bool | 否 | 是否把所有消息都设置为已读 |
输出: 无