Explorar o código

服务端发送消息,增加判断医生及PCIM是否在线,在线的话推送SOCKET消息

huangwenjie %!s(int64=5) %!d(string=hai) anos
pai
achega
cffee6a90e
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      src/server/models/client/wechat.client.js

+ 11 - 0
src/server/models/client/wechat.client.js

@ -103,6 +103,17 @@ class WechatClient extends RedisModel {
                }
            } else {
                if(doctorClient){
                    log.warn("doctor is online, sending via web socket. User id: ", targetUserId);
                    WechatClient.sendViaWebSocket(doctorClient.socket, message);
                }
                if(pc_doctorClient){
                    log.warn("pc_doctor is online, sending via web socket. User id: ", targetUserId);
                    WechatClient.sendViaWebSocket(pc_doctorClient.socket, message);
                }
                log.info("User's wechat endpoint is not online, sending via wechat template message. User id: ", targetUserId);
                var isSendWXTem = true;//是否发送微信模板
                if(message.content_type == CONTENT_TYPES.PrescriptionBloodStatus||message.content_type == CONTENT_TYPES.PrescriptionFollowupContent){