Skip to content

Commit

Permalink
refactor: 댓글 좋아요 서비스 메서드 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
melonturtle committed Mar 8, 2024
1 parent c4fbe03 commit ea73591
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ private void validateContent(String content) {

//== like ==//
@Transactional
public CommentReactionResponse likeCommentForMember(final Long memberId, final Long commentId, final Boolean enable) {
Member liker = findMember(memberId);
public CommentReactionResponse likeCommentByMember(final Long likerId, final Long commentId, final Boolean enable) {
Member liker = findMember(likerId);
Comment comment = findById(commentId);

if (enable) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/life/offonoff/ab/web/CommentController.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ResponseEntity<CommentReactionResponse> likeComment(
@PathVariable Long commentId,
@RequestParam Boolean enable
) {
return ResponseEntity.ok(commentService.likeCommentForMember(memberId, commentId, enable));
return ResponseEntity.ok(commentService.likeCommentByMember(memberId, commentId, enable));
}

@PostMapping("/{commentId}/hate")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void like_with_cancel_hate() {
liker.hateCommentIfNew(comment);

// when
commentService.likeCommentForMember(liker.getId(), comment.getId(), true);
commentService.likeCommentByMember(liker.getId(), comment.getId(), true);

// then
assertAll(
Expand Down

0 comments on commit ea73591

Please sign in to comment.