Browse Source

群聊删除字段改为解散字段

master
xsx 2 years ago
parent
commit
b9b4bd5084
  1. 2
      db/im-platform.sql
  2. 2
      im-platform/src/main/java/com/bx/implatform/entity/Group.java
  3. 4
      im-platform/src/main/java/com/bx/implatform/service/impl/GroupServiceImpl.java
  4. 4
      im-platform/src/main/java/com/bx/implatform/vo/GroupVO.java

2
db/im-platform.sql

@ -49,7 +49,7 @@ create table `im_group`(
`notice` varchar(1024) default '' comment '群公告', `notice` varchar(1024) default '' comment '群公告',
`is_banned` tinyint(1) default 0 comment '是否被封禁 0:否 1:是', `is_banned` tinyint(1) default 0 comment '是否被封禁 0:否 1:是',
`reason` varchar(255) default '' comment '被封禁原因', `reason` varchar(255) default '' comment '被封禁原因',
`deleted` tinyint(1) default 0 comment '是否已删除', `dissolve` tinyint(1) default 0 comment '是否已解散',
`created_time` datetime default CURRENT_TIMESTAMP comment '创建时间' `created_time` datetime default CURRENT_TIMESTAMP comment '创建时间'
)ENGINE=InnoDB CHARSET=utf8mb4 comment ''; )ENGINE=InnoDB CHARSET=utf8mb4 comment '';

2
im-platform/src/main/java/com/bx/implatform/entity/Group.java

@ -65,7 +65,7 @@ public class Group {
/** /**
* 是否已删除 * 是否已删除
*/ */
private Boolean deleted; private Boolean dissolve;

4
im-platform/src/main/java/com/bx/implatform/service/impl/GroupServiceImpl.java

@ -114,7 +114,7 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, Group> implements
// 群聊用户id // 群聊用户id
List<Long> userIds = groupMemberService.findUserIdsByGroupId(groupId); List<Long> userIds = groupMemberService.findUserIdsByGroupId(groupId);
// 逻辑删除群数据 // 逻辑删除群数据
group.setDeleted(true); group.setDissolve(true);
this.updateById(group); this.updateById(group);
// 删除成员数据 // 删除成员数据
groupMemberService.removeByGroupId(groupId); groupMemberService.removeByGroupId(groupId);
@ -190,7 +190,7 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, Group> implements
if (Objects.isNull(group)) { if (Objects.isNull(group)) {
throw new GlobalException("群组不存在"); throw new GlobalException("群组不存在");
} }
if (group.getDeleted()) { if (group.getDissolve()) {
throw new GlobalException("群组'" + group.getName() + "'已解散"); throw new GlobalException("群组'" + group.getName() + "'已解散");
} }
if (group.getIsBanned()) { if (group.getIsBanned()) {

4
im-platform/src/main/java/com/bx/implatform/vo/GroupVO.java

@ -44,8 +44,8 @@ public class GroupVO {
@Schema(description = "群名备注") @Schema(description = "群名备注")
private String remarkGroupName; private String remarkGroupName;
@Schema(description = "是否已删除") @Schema(description = "是否已解散")
private Boolean deleted; private Boolean dissolve;
@Schema(description = "是否已退出") @Schema(description = "是否已退出")
private Boolean quit; private Boolean quit;

Loading…
Cancel
Save