Skip to content

Commit

Permalink
refactor(CommentLikeDtoMapper): dto 변환 메소드명 of로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mingmingmon committed Dec 20, 2024
1 parent 5c93444 commit 7ac34ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@Component
public class CommentLikeDtoMapper {

public CommentLikeToggleResponseDto toDto(Long boardId, Long commentLikes, Boolean isDeleted) {
public CommentLikeToggleResponseDto of(Long boardId, Long commentLikes, Boolean isDeleted) {
return CommentLikeToggleResponseDto.builder()
.boardId(boardId)
.likes(commentLikes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public CommentLikeToggleResponseDto toggleLikeStatus(Long commentId) {
removeCommentLikePort.delete(commentLike);
comment.decrementLikes();
externalRegisterCommentUseCase.save(comment);
return mapper.toDto(boardId, comment.getLikes(), true);
return mapper.of(boardId, comment.getLikes(), true);
})
.orElseGet(() -> {
CommentLike newLike = CommentLike.create(currentMemberId, comment.getId());
registerCommentLikePort.save(newLike);
comment.incrementLikes();
externalRegisterCommentUseCase.save(comment);
return mapper.toDto(boardId, comment.getLikes(), false);
return mapper.of(boardId, comment.getLikes(), false);
});
}
}

0 comments on commit 7ac34ff

Please sign in to comment.