Skip to content

Comment and Reply ResponseData now contains Heart#51

Open
linuxlight wants to merge 12 commits into
mikekang47:mainfrom
linuxlight:heart
Open

Comment and Reply ResponseData now contains Heart#51
linuxlight wants to merge 12 commits into
mikekang47:mainfrom
linuxlight:heart

Conversation

@linuxlight

Copy link
Copy Markdown
Collaborator

No description provided.

@mikekang47 mikekang47 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고 많으셨어요...!

if (userComments.isEmpty())
throw new CommentNotFoundException();
return getCommentResponseDataList(userComments);
return userComments;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dto 변환 위치 변경하시느라 고생 많으셨습니다 :)

Comment on lines +49 to +50
List<Comment> comments = commentService.getComments();
return comments.stream().map(Comment::toCommentResponseData).collect(Collectors.toList());

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map 을 잘 활용하셨어요!

.commentId(id)
.userProfile(user.toUserProfileData())
.content(content)
.heartPresent(hearts.stream().anyMatch(heart -> heart.getUser().equals(user)))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anyMat를 사용하면 객체끼리 바로 비교가 가능한가보군요!
찾아 봐야겠어요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants