Bladeren bron

注销三方im

liujc 1 maand geleden
bovenliggende
commit
7d83173ee6

+ 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

@@ -27,6 +27,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;
@@ -80,6 +81,9 @@ public class SysUserServiceImpl implements SysUserService {
     private ImGroupService imGroupService;
 
     @Autowired
+    private ImGroupCoreService imGroupCoreService;
+
+    @Autowired
     private CourseGroupService courseGroupService;
 
     @Autowired
@@ -486,6 +490,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)));
         }
 
 
@@ -519,6 +526,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){

+ 1 - 1
pom.xml

@@ -24,7 +24,7 @@
 		<redisson.version>3.11.5</redisson.version>
 		<maven.test.skip>true</maven.test.skip>
 		<cbs.version>1.0.15</cbs.version>
-		<microsvc.version>1.0.8</microsvc.version>
+		<microsvc.version>1.0.8-RC1</microsvc.version>
 	</properties>