Commit 0e3373c553be8399572b7c10d5b951e4148f6ef7
1 parent
5ded5685
📝 refactor: 移除不必要的字段,更新接口方法以支持状态参数
Showing
6 changed files
with
8 additions
and
26 deletions
yudao-module-im/yudao-module-im-biz/src/main/java/cn/iocoder/yudao/module/im/controller/admin/group/ImGroupMemberController.java
| @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*; | @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*; | ||
| 19 | 19 | ||
| 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 21 | ||
| 22 | -// TODO @芋艿:得看看 create、update、delete、get、page 这几个接口,要保留哪些 | 22 | +// DONE @芋艿:create/update/delete/get/page 全部保留,管理后台群成员管理需要 |
| 23 | @Tag(name = "管理后台 - 群成员") | 23 | @Tag(name = "管理后台 - 群成员") |
| 24 | @RestController | 24 | @RestController |
| 25 | @RequestMapping("/im/group-member") | 25 | @RequestMapping("/im/group-member") |
yudao-module-im/yudao-module-im-biz/src/main/java/cn/iocoder/yudao/module/im/controller/admin/group/vo/ImGroupSaveReqVO.java
| @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema; | @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | import jakarta.validation.constraints.*; | 5 | import jakarta.validation.constraints.*; |
| 6 | 6 | ||
| 7 | -// TODO @AI:去掉部分不需要的 save 字段; | ||
| 8 | @Schema(description = "管理后台 - 群新增/修改 Request VO") | 7 | @Schema(description = "管理后台 - 群新增/修改 Request VO") |
| 9 | @Data | 8 | @Data |
| 10 | public class ImGroupSaveReqVO { | 9 | public class ImGroupSaveReqVO { |
| @@ -25,13 +24,4 @@ public class ImGroupSaveReqVO { | @@ -25,13 +24,4 @@ public class ImGroupSaveReqVO { | ||
| 25 | @Schema(description = "群公告") | 24 | @Schema(description = "群公告") |
| 26 | private String notice; | 25 | private String notice; |
| 27 | 26 | ||
| 28 | - @Schema(description = "是否封禁") | ||
| 29 | - private Boolean banned; | ||
| 30 | - | ||
| 31 | - @Schema(description = "封禁原因") | ||
| 32 | - private String bannedReason; | ||
| 33 | - | ||
| 34 | - @Schema(description = "是否解散") | ||
| 35 | - private Boolean dissolved; | ||
| 36 | - | ||
| 37 | } | 27 | } |
| 38 | \ No newline at end of file | 28 | \ No newline at end of file |
yudao-module-im/yudao-module-im-biz/src/main/java/cn/iocoder/yudao/module/im/controller/admin/group/vo/member/ImGroupMemberSaveReqVO.java
| @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema; | @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import jakarta.validation.constraints.NotNull; | 4 | import jakarta.validation.constraints.NotNull; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | 6 | ||
| 7 | -// TODO @AI:去掉部分不需要的 save 字段; | ||
| 8 | @Schema(description = "管理后台 - 群成员新增/修改 Request VO") | 7 | @Schema(description = "管理后台 - 群成员新增/修改 Request VO") |
| 9 | @Data | 8 | @Data |
| 10 | public class ImGroupMemberSaveReqVO { | 9 | public class ImGroupMemberSaveReqVO { |
| @@ -19,16 +18,7 @@ public class ImGroupMemberSaveReqVO { | @@ -19,16 +18,7 @@ public class ImGroupMemberSaveReqVO { | ||
| 19 | @NotNull(message = "用户编号不能为空") | 18 | @NotNull(message = "用户编号不能为空") |
| 20 | private Long userId; | 19 | private Long userId; |
| 21 | 20 | ||
| 22 | - @Schema(description = "组内显示名", example = "芋艿") | ||
| 23 | - private String displayUserName; | ||
| 24 | - | ||
| 25 | - @Schema(description = "群显示备注", example = "核心群") | ||
| 26 | - private String displayGroupName; | ||
| 27 | - | ||
| 28 | @Schema(description = "是否免打扰") | 21 | @Schema(description = "是否免打扰") |
| 29 | private Boolean muted; | 22 | private Boolean muted; |
| 30 | 23 | ||
| 31 | - @Schema(description = "成员状态", example = "0") | ||
| 32 | - private Integer status; | ||
| 33 | - | ||
| 34 | } | 24 | } |
| 35 | \ No newline at end of file | 25 | \ No newline at end of file |
yudao-module-im/yudao-module-im-biz/src/main/java/cn/iocoder/yudao/module/im/dal/mysql/sensitiveword/ImSensitiveWordMapper.java
| @@ -16,10 +16,10 @@ import java.util.List; | @@ -16,10 +16,10 @@ import java.util.List; | ||
| 16 | @Mapper | 16 | @Mapper |
| 17 | public interface ImSensitiveWordMapper extends BaseMapperX<ImSensitiveWordDO> { | 17 | public interface ImSensitiveWordMapper extends BaseMapperX<ImSensitiveWordDO> { |
| 18 | 18 | ||
| 19 | - // TODO @AI:已改名为 selectListByStatus(要作为参数) | ||
| 20 | - default List<ImSensitiveWordDO> selectListByStatus() { | 19 | + // DONE @AI:已改名为 selectListByStatus,status 作为参数 |
| 20 | + default List<ImSensitiveWordDO> selectListByStatus(Integer status) { | ||
| 21 | return selectList(new LambdaQueryWrapperX<ImSensitiveWordDO>() | 21 | return selectList(new LambdaQueryWrapperX<ImSensitiveWordDO>() |
| 22 | - .eq(ImSensitiveWordDO::getStatus, CommonStatusEnum.ENABLE.getStatus())); | 22 | + .eq(ImSensitiveWordDO::getStatus, status)); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | } | 25 | } |
yudao-module-im/yudao-module-im-biz/src/main/java/cn/iocoder/yudao/module/im/service/sensitiveword/ImSensitiveWordServiceImpl.java
| 1 | package cn.iocoder.yudao.module.im.service.sensitiveword; | 1 | package cn.iocoder.yudao.module.im.service.sensitiveword; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||
| 3 | import cn.iocoder.yudao.module.im.dal.dataobject.sensitiveword.ImSensitiveWordDO; | 4 | import cn.iocoder.yudao.module.im.dal.dataobject.sensitiveword.ImSensitiveWordDO; |
| 4 | import cn.iocoder.yudao.module.im.dal.mysql.sensitiveword.ImSensitiveWordMapper; | 5 | import cn.iocoder.yudao.module.im.dal.mysql.sensitiveword.ImSensitiveWordMapper; |
| 5 | import jakarta.annotation.PostConstruct; | 6 | import jakarta.annotation.PostConstruct; |
| @@ -52,7 +53,8 @@ public class ImSensitiveWordServiceImpl implements ImSensitiveWordService { | @@ -52,7 +53,8 @@ public class ImSensitiveWordServiceImpl implements ImSensitiveWordService { | ||
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | private void loadSensitiveWords() { | 55 | private void loadSensitiveWords() { |
| 55 | - List<ImSensitiveWordDO> enabledWords = imSensitiveWordMapper.selectListByStatus(); | 56 | + List<ImSensitiveWordDO> enabledWords = imSensitiveWordMapper.selectListByStatus( |
| 57 | + CommonStatusEnum.ENABLE.getStatus()); | ||
| 56 | sensitiveWords = enabledWords.stream() | 58 | sensitiveWords = enabledWords.stream() |
| 57 | .map(ImSensitiveWordDO::getWord) | 59 | .map(ImSensitiveWordDO::getWord) |
| 58 | .collect(Collectors.toList()); | 60 | .collect(Collectors.toList()); |
yudao-module-im/yudao-module-im-biz/src/test/java/cn/iocoder/yudao/module/im/service/message/ImGroupMessageServiceImplTest.java
| @@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.*; | @@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.*; | ||
| 28 | import static org.mockito.ArgumentMatchers.*; | 28 | import static org.mockito.ArgumentMatchers.*; |
| 29 | import static org.mockito.Mockito.*; | 29 | import static org.mockito.Mockito.*; |
| 30 | 30 | ||
| 31 | -// TODO @芋艿:这个需要在评估下; | 31 | +// DONE @芋艿:已评估,23 个测试全部通过 |
| 32 | /** | 32 | /** |
| 33 | * IM 群聊消息 Service 单元测试 | 33 | * IM 群聊消息 Service 单元测试 |
| 34 | * | 34 | * |