Skip to content

Commit

Permalink
[Refactor/#308] feedback by comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Han-Jeong committed Jun 20, 2024
1 parent 4ad4769 commit 7efb92b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public Long createComment(Long boardId, CommentRequest createCommentRequest, Mem
commentRepository.save(comment);

//MENTION
List<Notification> notificationList = buildNotificationListByMention(comment, buildMentionDto(comment));
List<Notification> notificationList = buildMentionNotification(comment, buildMentionDto(comment));

//COMMENT
notificationList.add(buildNotificationByComment(comment, buildCommentDto(comment)));
notificationList.add(buildCommentNotification(comment, buildCommentDto(comment)));
notificationRepository.saveAll(notificationList);
return comment.getId();
}
Expand All @@ -74,7 +74,7 @@ public Long updateComment(Long commentId, CommentRequest updateCommentRequest, M

comment.changeContent(updateCommentRequest.getContent());
//MENTION
List<Notification> notificationList = buildNotificationListByMention(comment, buildMentionDto(comment));
List<Notification> notificationList = buildMentionNotification(comment, buildMentionDto(comment));
notificationRepository.saveAll(notificationList);
return comment.getId();
}
Expand Down Expand Up @@ -118,7 +118,7 @@ private Comment buildComment(Board board, CommentRequest createCommentRequest, M
.build();
}

private Notification buildNotificationByComment(Comment comment, CommentDto content) {
private Notification buildCommentNotification(Comment comment, CommentDto content) {
return Notification.builder()
.sender(comment.getMember())
.receiver(comment.getBoard().getMember())
Expand All @@ -128,7 +128,7 @@ private Notification buildNotificationByComment(Comment comment, CommentDto cont
.build();
}

private List<Notification> buildNotificationListByMention(Comment comment, MentionDto content) {
private List<Notification> buildMentionNotification(Comment comment, MentionDto content) {
return ParseUtil.parsingUserUrl(comment)
.stream()
.map(userUrl -> memberRepository.findByUserUrl(userUrl)
Expand Down

0 comments on commit 7efb92b

Please sign in to comment.