|
@ -65,15 +65,19 @@ class WechatClient extends RedisModel {
|
|
|
if (patientClient) {
|
|
|
log.warn("User's wechat endpoint is online, sending via web socket. User id: ", targetUserId);
|
|
|
WechatClient.sendViaWebSocket(patientClient.socket, message);
|
|
|
|
|
|
if(doctorClient){
|
|
|
log.error("doctor sessionid "+doctorClient.sessionId);
|
|
|
log.error("patient sessionid "+patientClient.sessionId);
|
|
|
if(patientClient.sessionId==doctorClient.sessionId){
|
|
|
//用户socket在线,推送给用户后,告知医生此消息已读
|
|
|
WechatClient.sendReadDoctor(doctorClient.socket, message);
|
|
|
}
|
|
|
}else{
|
|
|
log.error("doctor client not found");
|
|
|
}
|
|
|
} else {
|
|
|
log.info("User's wechat endpoint is not online, sending via wechat template message. User id: ", targetUserId);
|
|
|
|
|
|
WechatClient.sendViaMessageTemplate(targetUserId, targetUserName, message);
|
|
|
}
|
|
|
}
|