|
@@ -419,6 +419,23 @@ public class GroupsServiceImpl extends ServiceImpl<GroupsMapper, Groupss>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 解散群聊
|
|
|
+ @Override
|
|
|
+ public Result delGroup(OutGroupsDto outGroupsDto) {
|
|
|
+ GroupMembers groupMembers = groupMembersMapper.selectOne(new LambdaQueryWrapper<GroupMembers>().eq(GroupMembers::getGroupId, outGroupsDto.getGroupsId()).eq(GroupMembers::getUserId, outGroupsDto.getUid()));
|
|
|
+ if (groupMembers.getRole()==2){
|
|
|
+ Groupss groupss = this.baseMapper.selectById(outGroupsDto.getGroupsId());
|
|
|
+ this.baseMapper.deleteById(groupss);
|
|
|
+ List<GroupMembers> list = groupMembersMapper.selectList(new LambdaQueryWrapper<GroupMembers>().eq(GroupMembers::getGroupId, outGroupsDto.getGroupsId()));
|
|
|
+ groupMembersMapper.deleteBatchIds(list);
|
|
|
+ List<UserShouye> userShouyes = userShouyeMapper.selectList(new LambdaQueryWrapper<UserShouye>().eq(UserShouye::getGid, outGroupsDto.getGroupsId()));
|
|
|
+ userShouyeMapper.deleteBatchIds(userShouyes);
|
|
|
+ return Result.OK(null,"解散成功");
|
|
|
+ }else{
|
|
|
+ return Result.ERR(null,"权限不足");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|