Browse Source

1.注册代码同步

yuanliang 1 year ago
parent
commit
5dafe1864e

+ 7 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ImUserFriendServiceImpl.java

@@ -233,6 +233,13 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
     @Override
     public Integer registerUserBindCustomerService(Long userId, List<Long> friendIds, ClientEnum clientType) {
 
+        SysUser sysUser = sysUserMapper.getByUserId(userId);
+        try {
+            imGroupService.register(sysUser.getId().toString(), clientType, sysUser.getUsername(), sysUser.getAvatar());
+            log.info("注册用户成功:" + userId);
+        } catch (Exception e) {
+            log.error("注册用户失败:" + userId + ",type:" + clientType);
+        }
         // 添加新用户好友,客服默认为老师身份
         for (Long teacherId : friendIds) {
             if (ClientEnum.STUDENT == clientType) {