Parcourir la source

新个微对接

吴树波 il y a 2 jours
Parent
commit
4ece771903

+ 2 - 0
fs-wx-api/src/main/java/com/fs/app/enums/CmdType.java

@@ -3,6 +3,8 @@ package com.fs.app.enums;
 public enum CmdType {
     // 心跳
     HEARTBEAT,
+    // 初始化备注
+    INIT_REMARK,
     // 数据返回
     RETURN,
     // 退出登录

+ 5 - 4
fs-wx-api/src/main/java/com/fs/app/websocket/service/WebSocketServer.java

@@ -3,14 +3,13 @@ package com.fs.app.websocket.service;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fs.app.enums.CmdType;
 import com.fs.app.websocket.bean.ResultMsgVo;
 import com.fs.app.websocket.bean.SendMsgVo;
 import com.fs.company.domain.CompanyWxClient;
 import com.fs.company.mapper.CompanyWxClientMapper;
 import com.fs.company.service.impl.CompanyWxServiceImpl;
-import com.fs.wxcid.vo.wxvo.ContactInfoVo;
-import com.fs.wxcid.vo.wxvo.SyncInfoVo;
-import com.fs.wxcid.vo.wxvo.WxSendMsgVo;
+import com.fs.wxcid.vo.wxvo.*;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.spring.SpringUtils;
@@ -19,7 +18,6 @@ import com.fs.company.mapper.CompanyWxAccountMapper;
 import com.fs.wxcid.domain.WxContact;
 import com.fs.wxcid.mapper.WxContactMapper;
 import com.fs.wxcid.service.IWxMsgLogService;
-import com.fs.wxcid.vo.wxvo.WxSendResultMsgVo;
 import com.hc.openapi.tool.fastjson.JSON;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
@@ -72,6 +70,9 @@ public class WebSocketServer {
         companyWxAccount.setLoginStatus(1);
         companyWxAccount.setLoginTime(LocalDateTime.now());
         accountMapper.updateById(companyWxAccount);
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("remark", companyWxAccount.getRemark());
+        sendMessage(session, ResultMsgVo.<JSONObject>builder().cmd(CmdType.INIT_REMARK).data(jsonObject).build());
         log.info("{}加入webSocket!当前人数为{}", wxId, sessionPools.size());
     }