Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public record RootCommentDto(
Long creatorId,
String creatorProfileImageUrl,
String creatorNickname,
String alias,
String aliasName,
String aliasColor,
String postDate, // 댓글 작성 시각 (~ 전 형식)
String content,
Expand All @@ -27,7 +27,7 @@ public record ReplyDto(
Long creatorId,
String creatorProfileImageUrl,
String creatorNickname,
String alias,
String aliasName,
String aliasColor,
String postDate, // 댓글 작성 시각 (~ 전 형식)
String content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ public interface CommentQueryMapper {
@Mapping(target = "isLike", expression = "java(likedCommentIds.contains(root.commentId()))")
@Mapping(target = "isDeleted", constant = "false")
@Mapping(target = "postDate", expression = "java(DateUtil.formatBeforeTime(root.createdAt()))")
CommentForSinglePostResponse.RootCommentDto toRoot(CommentQueryDto root,
@Context Set<Long> likedCommentIds);
@Mapping(target = "aliasName", source = "root.alias")
CommentForSinglePostResponse.RootCommentDto toRoot(CommentQueryDto root, @Context Set<Long> likedCommentIds);

/**
* 개별 답글 매핑
*/
@Mapping(target = "isLike", expression = "java(likedCommentIds.contains(child.commentId()))")
@Mapping(target = "postDate", expression = "java(DateUtil.formatBeforeTime(child.createdAt()))")
@Mapping(target = "aliasName", source = "child.alias")
CommentForSinglePostResponse.RootCommentDto.ReplyDto toReply(CommentQueryDto child, @Context Set<Long> likedCommentIds);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public record MemberSearchResult(
Long userId,
String nickname,
String imageUrl,
String alias,
String aliasName,
int followerCount
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public RoomGetMemberListResponse getRoomMemberList(Long roomId) {
.userId(userId)
.nickname(user.getNickname())
.imageUrl(user.getAlias().getImageUrl())
.alias(user.getAlias().getValue())
.aliasName(user.getAlias().getValue())
.followerCount(user.getFollowerCount())
.build();
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,17 @@ void getRoomMemberList_success() throws Exception {
.andExpect(jsonPath("$.data.userList[0].userId").value(user1.getUserId().intValue()))
.andExpect(jsonPath("$.data.userList[0].nickname").exists())
.andExpect(jsonPath("$.data.userList[0].imageUrl").exists())
.andExpect(jsonPath("$.data.userList[0].alias").exists())
.andExpect(jsonPath("$.data.userList[0].aliasName").exists())
.andExpect(jsonPath("$.data.userList[0].followerCount").isNumber())
.andExpect(jsonPath("$.data.userList[1].userId").value(user2.getUserId().intValue()))
.andExpect(jsonPath("$.data.userList[1].nickname").exists())
.andExpect(jsonPath("$.data.userList[1].imageUrl").exists())
.andExpect(jsonPath("$.data.userList[1].alias").exists())
.andExpect(jsonPath("$.data.userList[1].aliasName").exists())
.andExpect(jsonPath("$.data.userList[1].followerCount").isNumber())
.andExpect(jsonPath("$.data.userList[2].userId").value(user3.getUserId().intValue()))
.andExpect(jsonPath("$.data.userList[2].nickname").exists())
.andExpect(jsonPath("$.data.userList[2].imageUrl").exists())
.andExpect(jsonPath("$.data.userList[2].alias").exists())
.andExpect(jsonPath("$.data.userList[2].aliasName").exists())
.andExpect(jsonPath("$.data.userList[2].followerCount").isNumber());
}

Expand Down