diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseCommentDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseCommentDTO.java index e711ddf78a..b25c8fe82e 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseCommentDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseCommentDTO.java @@ -1,6 +1,7 @@ package io.metersphere.functional.dto; import io.metersphere.functional.domain.FunctionalCaseComment; +import io.metersphere.system.dto.CommentUserInfo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -9,17 +10,8 @@ import java.util.List; @Data public class FunctionalCaseCommentDTO extends FunctionalCaseComment { - @Schema(description = "评论的人名") - private String userName; - - @Schema(description = "被回复的人名") - private String replyUserName; - - @Schema(description = "被回复的人头像") - private String replyUserLogo; - - @Schema(description = "评论的人头像") - private String userLogo; + @Schema(description = "评论相关用户信息") + private List commentUserInfos; @Schema(description = "该条评论下的所有回复数据") private List childComments; diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseCommentService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseCommentService.java index caa64dc8ec..db7c732406 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseCommentService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseCommentService.java @@ -242,13 +242,19 @@ public class FunctionalCaseCommentService { Listlist = new ArrayList<>(); for (FunctionalCaseComment functionalCaseComment : functionalCaseComments) { FunctionalCaseCommentDTO functionalCaseCommentDTO = new FunctionalCaseCommentDTO(); + ListcommentUserInfos = new ArrayList<>(); BeanUtils.copyBean(functionalCaseCommentDTO,functionalCaseComment); - functionalCaseCommentDTO.setUserName(userMap.get(functionalCaseComment.getCreateUser()).getName()); - functionalCaseCommentDTO.setUserLogo(userMap.get(functionalCaseComment.getCreateUser()).getAvatar()); + CommentUserInfo createUserInfo = userMap.get(functionalCaseComment.getCreateUser()); + commentUserInfos.add(createUserInfo); if (StringUtils.isNotBlank(functionalCaseComment.getReplyUser())) { - functionalCaseCommentDTO.setReplyUserName(userMap.get(functionalCaseComment.getReplyUser()).getName()); - functionalCaseCommentDTO.setReplyUserLogo(userMap.get(functionalCaseComment.getReplyUser()).getAvatar()); + CommentUserInfo replyUserInfo = userMap.get(functionalCaseComment.getReplyUser()); + commentUserInfos.add(replyUserInfo); } + if (StringUtils.isNotBlank(functionalCaseComment.getNotifier())) { + List notifiers = Arrays.asList(functionalCaseComment.getNotifier().split(";")); + notifiers.forEach(t-> commentUserInfos.add(userMap.get(functionalCaseComment.getReplyUser()))); + } + functionalCaseCommentDTO.setCommentUserInfos(commentUserInfos); list.add(functionalCaseCommentDTO); } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/CommentUserInfo.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/CommentUserInfo.java index 9c55e6c470..1e2475c1fd 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/CommentUserInfo.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/CommentUserInfo.java @@ -3,8 +3,14 @@ package io.metersphere.system.dto; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; +import java.io.Serializable; + @Data -public class CommentUserInfo{ +public class CommentUserInfo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; @Schema(description = "用户ID") private String id;