liujc 9 月之前
父節點
當前提交
22fe768615

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

@@ -92,6 +92,13 @@ public interface ImGroupCoreService {
     void groupQuit(GroupMemberWrapper.ImGroupMember groupMember, String groupId,Boolean quit) throws Exception;
 
     /**
+     * 删除IM用户
+     *
+     * @param imUserIds
+     */
+    void  accountDelete(List<String> imUserIds);
+
+    /**
      * 用户主动退出群聊
      * @param userId 用户信息
      * @param clientType EClientType

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/im/impl/ImGroupCoreServiceImpl.java

@@ -402,6 +402,17 @@ public class ImGroupCoreServiceImpl implements ImGroupCoreService {
         }
     }
 
+    @Override
+    public void  accountDelete(List<String> imUserIds) {
+        try {
+            imPluginContext.getPluginService().accountDelete(imUserIds);
+        } catch (Exception e) {
+            log.error("accountDelete error",e);
+
+        }
+
+    }
+
     /**
      * 用户主动退出群聊
      *

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

@@ -26,6 +26,7 @@ import com.yonge.cooleshow.biz.dal.enums.*;
 import com.yonge.cooleshow.biz.dal.enums.im.EImGroupMemberRoleType;
 import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper;
 import com.yonge.cooleshow.biz.dal.service.*;
+import com.yonge.cooleshow.biz.dal.service.im.ImGroupCoreService;
 import com.yonge.cooleshow.biz.dal.vo.UserAccountVo;
 import com.yonge.cooleshow.biz.dal.wrapper.UserInfoWrapper;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
@@ -81,6 +82,9 @@ public class SysUserServiceImpl implements SysUserService {
     private ImGroupService imGroupService;
 
     @Autowired
+    private ImGroupCoreService imGroupCoreService;
+
+    @Autowired
     private CourseGroupService courseGroupService;
 
     @Autowired
@@ -487,6 +491,9 @@ public class SysUserServiceImpl implements SysUserService {
                     .eq(ImUserFriend::getFriendId, userId)
                     .eq(ImUserFriend::getFriendType, EClientType.STUDENT)
                     .remove();
+
+            // 注销三方im
+            imGroupCoreService.accountDelete(Lists.newArrayList(imGroupCoreService.getImUserId(userId, ClientEnum.STUDENT)));
         }
 
 
@@ -520,6 +527,8 @@ public class SysUserServiceImpl implements SysUserService {
                     .eq(ImUserFriend::getFriendId, userId)
                     .eq(ImUserFriend::getFriendType, EClientType.TEACHER)
                     .remove();
+            // 注销三方im
+            imGroupCoreService.accountDelete(Lists.newArrayList(imGroupCoreService.getImUserId(userId, ClientEnum.TEACHER)));
         }
     }
     public EClientType getClientType(String jpushType){