聊天-查询历史聊天记录
开发中
GET
/chatMsgList
聊天对话
客户端使用getChatMsgList请求获取聊天记录信息
使用chatMsgList 接收聊天记录结果
代码示例:
function getMsgHistory() {
//向socket服务端发送数据 参数:pageSize: number, lastTime: string, orderId: string
socket.emit('getChatMsgList', 20, '2022-08-26 ', '276027147277');
}
socket.on('chatMsgList', event => {
var str = document.getElementById('msgShowHistory').innerText;
var test = document.createElement('span');
// 返回的聊天记录信息
test.appendChild(document.createTextNode(JSON.stringify(event)));
var test2 = document.createElement('p');
document
.getElementById('msgShowHistory')
.appendChild(test)
.appendChild(test2);
});
请求参数
Query 参数
pageSize
string
默认30条
lastTime
string
最后一次时间
orderId
string
必需
Header 参数
Content-Type
string
必需
示例值:
application/json
authorization
string
可选
示例值:
{{Btoken}}
示例代码
返回响应
修改于 2024-03-30 02:12:44