chat.msg-box.items
拉取消息盒子条目
- 请求路由:
chat.msg-box.items- 交互模型:
Request Stream- 访问限制: 无
注意消息盒子中包含各类消息的最新条目,如聊天消息,群消息等,这些条目需要客户端自行根据lastMessage.ts进行排序
请求
RSocket.rs({
"route" : "chat.msg-box.items",
"args" : {
"mucScopes" : [
"cbv-driver-group"
]
}
});
请求参数
| 名称 | 类型 | 必须 | 说明 |
|---|---|---|---|
mucScopes | String | 否 | 当需要获取用户所属,由其他应用创建的群房间条目时,提供这些应用scope列表。 |
返回
消息盒子条目
[
{
"targetId" : "13500020002@mzd",
"dirty" : true,
"lastMessage" : {
"seq" : 39,
"id" : "e6404191e56c47839288e1d3245cf0ef",
"from" : "13500010001@mzd",
"to" : "135000200032@mzd",
"resource" : "127.0.0.1:58207",
"type" : "chat",
"body" : "Hello Taurus Chat",
"ts" : "2024-11-03T04:08:35.845Z",
"tenantId" : "mzd"
}
},
{
"targetId" : "672470600308b10b2b2c0663@mzd",
"dirty" : false,
"lastMessage" : {
"seq" : 46,
"id" : "3652da7fefc34c34881f3c524c383e1f",
"from" : "13500020002@mzd",
"to" : "672470600308b10b2b2c0663@mzd",
"resource" : "127.0.0.1:61575",
"type" : "groupchat",
"body" : "Hello Taurus Group Chat!",
"ts" : "2024-11-03T23:51:20.378Z",
"tenantId" : "mzd"
}
}
]
返回属性
| 名称 | 类型 | 说明 |
|---|---|---|
targetId | String | 目标Id |
targetName | String | 用户名 或群名 |
dirty | Boolean | 为true时,存在未读消息 |
lastMessage | Object | 最新的消息 |
lastMessage.seq | Number | 消息序列号,可作为排序依据 |
lastMessage.ts | String | 消息时间戳 |
lastMessage.tenantId | String | 租户标识 |
lastMessage.id | String | 消息标识 |
lastMessage.from | String | 消息发送者 |
lastMessage.to | String | 消息接收者 |
lastMessage.resource | String | 客户端标识 |
lastMessage.type | String | 消息类型 |
lastMessage.body | String | 消息内容 |
lastMessage.x | Object[] | 消息扩展 |