聊天-查询历史聊天记录
开发中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}}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
success
boolean
请求成功标志
code
number
可选
请求成功10000标志
message
string
请求成功
data
array [object {4}]
可选
sid
string
可选
绘话id-socket链接id
orderId
string
可选
订单id-关联业务id
createTime
string
绘话时间
items
array [object {5}]
可选
示例
{
"success": true,
"code": 0,
"message": "string",
"data": [
{
"sid": "string",
"orderId": "string",
"createTime": "string",
"items": [
{
"id": "string",
"from": "string",
"to": "string",
"msgType": 0,
"msg": {
"consultRecord": {
"id": "string",
"orderNo": "string",
"type": "string",
"createTime": "string",
"illnessDesc": "string",
"illnessTime": 0,
"consultFlag": 0,
"liverFunction": 0,
"renalFunction": 0,
"allergicHistory": 0,
"fertilityStatus": 0,
"patientInfo": {
"id": "string",
"name": "string",
"idCard": "string",
"gender": 0,
"age": "string"
},
"medicines": [
{
"id": "string",
"name": "string",
"specs": "string",
"usageDosag": "string",
"quantity": 0
}
],
"pictures": [
{
"id": "string",
"url": "string"
}
]
},
"prescription": {
"id": "string",
"createTime": "string",
"name": "string",
"recordId": "string",
"gender": 0,
"age": "string",
"diagnosis": "string",
"status": 1,
"medicines": [
{
"id": "string",
"name": "string",
"amount": "string",
"avatar": "string",
"specs": "string",
"usageDosag": "string",
"prescriptionFlag": "string",
"quantity": 0
}
],
"orderId": "string"
},
"content": "string",
"picture": {
"id": "string",
"url": "string"
},
"evaluateDoc\t": {
"id": "string",
"score": 0,
"content": "string",
"createTime": "string",
"creator": "string"
}
}
}
]
}
]
}
最后修改时间: 10 个月前