文档
测试

获取消息

GET
http://localhost:520/api/chat?type=all&page=1&pageSize=10

请求参数

参数名
类型
描述
必填
type
string
示例:all or unread
必填
page
int
示例:1
必填
pageSize
int
示例:10
必填

响应参数

参数名
类型
描述
必填
code
int
示例:0
必填
msg
string
示例:success
必填
data
object
数据字典
必填
page
int
示例:1
必填
pageSize
int
示例:10
必填
total
int
示例:2
必填
list
array
数据列表
必填
id
int
示例:1
必填
afterMessage
object
示例:null
必填
fromId
int
示例:1
必填
toId
int
示例:3
必填
created_at
string
示例:2020-11-20T12:01:51.000Z
必填
messages
array
数据列表
必填
id
int
示例:1
必填
message
string
示例:1111
必填
status
boolean
示例:true
必填
fromId
int
示例:1
必填
toId
int
示例:3
必填
belong
int
示例:1
必填
cId
int
示例:1
必填
created_at
string
示例:2020-11-20T19:20:12.000Z
必填
user
object
数据字典
必填
userName
string
示例:lpl
必填
id
int
示例:3
必填
nickname
string
示例:lck
必填
image
string
示例:http://192.168.160.72:520/static/images/test.png
必填

说明 / 示例

```json { "code": 0, "msg": "success", "data": { "page": 1, "pageSize": 10, "total": 2, "list": [ { "id": 1, "afterMessage": null, "fromId": 1, "toId": 3, "created_at": "2020-11-20T12:01:51.000Z", "messages": [ { "id": 1, "message": "1111", "status": true, "fromId": 1, "toId": 3, "belong": 1, "cId": 1, "created_at": "2020-11-20T19:20:12.000Z" }, { "id": 2, "message": "2222", "status": true, "fromId": 1, "toId": 3, "belong": 3, "cId": 1, "created_at": "2020-11-20T19:20:36.000Z" } ], "user": { "userName": "lpl", "id": 3, "nickname": "lck", "image": "http://192.168.160.72:520/static/images/test.png" } }, { "id": 3, "afterMessage": "第五次发消息", "fromId": 1, "toId": 2, "created_at": "2020-11-21T02:57:56.000Z", "messages": [ { "id": 3, "message": "第一次发消息", "status": true, "fromId": 1, "toId": 2, "belong": 1, "cId": 3, "created_at": "2020-11-21T06:31:47.000Z" }, { "id": 6, "message": "第二次发消息", "status": true, "fromId": 1, "toId": 2, "belong": 1, "cId": 3, "created_at": "2020-11-21T06:44:47.000Z" }, { "id": 8, "message": "第三次发消息", "status": false, "fromId": 1, "toId": 2, "belong": 1, "cId": 3, "created_at": "2020-11-21T06:47:04.000Z" }, { "id": 10, "message": "第四次发消息", "status": false, "fromId": 1, "toId": 2, "belong": 1, "cId": 3, "created_at": "2020-11-21T07:48:34.000Z" }, { "id": 18, "message": "第五次发消息", "status": false, "fromId": 2, "toId": 1, "belong": 1, "cId": 3, "created_at": "2020-11-23T00:53:20.000Z" } ], "user": { "userName": "beishi", "id": 2, "nickname": "add", "image": "http://192.168.160.72:520/static/images/test-avatar.png" } } ] } } ```