Conversation
kdomo
reviewed
Feb 24, 2023
Member
kdomo
left a comment
There was a problem hiding this comment.
로직은 잘 짜주셨어용 👍🏻
로직 외적으로 수정할 부분 코멘트 남겨놓겠습니당
Comment on lines
+32
to
+40
| @Builder | ||
| public MyCommentResponseDto(Page<Comment> comments) { | ||
| totalPage = comments.getTotalPages(); | ||
| totalCount = comments.getTotalElements(); | ||
| myCommentDtos = comments.getContent().stream() | ||
| .map( | ||
| comment -> MyCommentDto.builder().comment(comment).build() | ||
| ).collect(Collectors.toList()); | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| @Builder | |
| public MyCommentResponseDto(Page<Comment> comments) { | |
| totalPage = comments.getTotalPages(); | |
| totalCount = comments.getTotalElements(); | |
| myCommentDtos = comments.getContent().stream() | |
| .map( | |
| comment -> MyCommentDto.builder().comment(comment).build() | |
| ).collect(Collectors.toList()); | |
| } | |
| private MyCommentResponseDto( | |
| Integer totalPage, | |
| Long totalCount, | |
| List<MyCommentDto> myCommentDtos | |
| ) { | |
| this.totalPage = totalPage; | |
| this.totalCount = totalCount; | |
| this.myCommentDtos = myCommentDtos; | |
| } | |
| public static MyCommentResponseDto of(Page<Comment> comments) { | |
| return new MyCommentResponseDto( | |
| comments.getTotalPages(), | |
| comments.getTotalElements(), | |
| comments.getContent().stream() | |
| .map( | |
| comment -> MyCommentDto.of(comment) | |
| ).collect(Collectors.toList()) | |
| ); | |
| } |
Comment on lines
+236
to
+238
| return MyCommentResponseDto.builder() | ||
| .comments(findComments) | ||
| .build(); |
Member
There was a problem hiding this comment.
Suggested change
| return MyCommentResponseDto.builder() | |
| .comments(findComments) | |
| .build(); | |
| return MyCommentResponseDto.of(findComments); |
Comment on lines
+44
to
+54
| @Builder | ||
| public MyCommentDto(Comment comment) { | ||
| this.categoryName = comment.getRecord().getRecordCategory().getName(); | ||
| this.recordId = comment.getRecord().getId(); | ||
| this.title = comment.getRecord().getTitle(); | ||
| this.iconName = comment.getRecord().getRecordIcon().getName(); | ||
| this.colorName = comment.getRecord().getRecordColor().getName(); | ||
| this.recordCreatedAt = comment.getRecord().getCreatedAt(); | ||
| this.commentContent = comment.getContent(); | ||
| this.commentCreatedAt = comment.getCreatedAt(); | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| @Builder | |
| public MyCommentDto(Comment comment) { | |
| this.categoryName = comment.getRecord().getRecordCategory().getName(); | |
| this.recordId = comment.getRecord().getId(); | |
| this.title = comment.getRecord().getTitle(); | |
| this.iconName = comment.getRecord().getRecordIcon().getName(); | |
| this.colorName = comment.getRecord().getRecordColor().getName(); | |
| this.recordCreatedAt = comment.getRecord().getCreatedAt(); | |
| this.commentContent = comment.getContent(); | |
| this.commentCreatedAt = comment.getCreatedAt(); | |
| } | |
| private MyCommentDto( | |
| String categoryName, | |
| Long recordId, | |
| String title, | |
| String iconName, | |
| String colorName, | |
| LocalDateTime recordCreatedAt, | |
| String commentContent, | |
| LocalDateTime commentCreatedAt | |
| ) { | |
| this.categoryName = categoryName; | |
| this.recordId = recordId; | |
| this.title = title; | |
| this.iconName = iconName; | |
| this.colorName = colorName; | |
| this.recordCreatedAt = recordCreatedAt; | |
| this.commentContent = commentContent; | |
| this.commentCreatedAt = commentCreatedAt; | |
| } | |
| public static MyCommentDto of(Comment comment) { | |
| return new MyCommentDto( | |
| comment.getRecord().getRecordCategory().getName(), | |
| comment.getRecord().getId(), | |
| comment.getRecord().getTitle(), | |
| comment.getRecord().getRecordIcon().getName(), | |
| comment.getRecord().getRecordColor().getName(), | |
| comment.getRecord().getCreatedAt(), | |
| comment.getContent(), | |
| comment.getCreatedAt() | |
| ); | |
| } |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈 번호
설명
내 댓글 관리기능의 내가 작성한 댓글을 조회하는 API를 개발하였습니다.
변경사항
질문사항