Merged
Conversation
wlsh44
requested changes
Feb 24, 2025
| package com.swyp8team2.comment.domain; | ||
|
|
||
| import com.swyp8team2.common.domain.BaseEntity; | ||
| import jakarta.persistence.*; |
Contributor
There was a problem hiding this comment.
요거 개별 import로 수정해주시면 좋을 것 같아요
|
|
||
| @GetMapping("") | ||
| public ResponseEntity<CursorBasePaginatedResponse<CommentResponse>> findComments( | ||
| public ResponseEntity<CursorBasePaginatedResponse<CommentResponse>> selectComments( |
Contributor
There was a problem hiding this comment.
이거는 통일하면 좋을 것 같은데 조회에서는 select를 더 선호하시나요?
Member
Author
There was a problem hiding this comment.
create update에 맞춰서 select했었는데 그 외에는 큰 이유가 없어서
select는 find로 통일하도록 하겠습니다
| CursorBasePaginatedResponse<CommentResponse> response = | ||
| new CursorBasePaginatedResponse<>(null, false, commentList); | ||
|
|
||
| when(commentService.selectComments(eq(postId), eq(cursor), eq(size))).thenReturn(response); |
Contributor
There was a problem hiding this comment.
이건 취향인데 저는 개인적으로 BDDMockito의 given을 더 선호하기는 합니다!
물론 이대로 냅두셔도 좋아요~
Member
Author
There was a problem hiding this comment.
리팩토링 기간에 given도 참고하면서 비교해보겠습니다!
| fieldWithPath("data[].voteId") | ||
| .type(JsonFieldType.NUMBER) | ||
| .optional() | ||
| .description("작성자 투표 Id (투표 없을 시 null)"), |
Contributor
There was a problem hiding this comment.
이거 댓글 작성자가 어떤 사진에 투표했는지 알기 위해서 추가한 값이라 있어야 할 것 같아요
아직 제가 투표 구현한 걸 못 올려서 dto 만들 때 null 값으로 넣고 응답하는 식으로 해주시면 감사하겠습니다!
|
|
||
| private CommentResponse createCommentResponse(Comment comment) { | ||
| Optional<User> user = userRepository.findById(comment.getUserNo()); | ||
| return CommentResponse.of(comment, user.get()); |
Contributor
There was a problem hiding this comment.
user.get()에서 유저가 없을 때 예외처리가 필요할 것 같습니다
Member
Author
|
내용 수정했습니다! |
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.
🚀 작업 내용 설명
📢 그 외
📌 �관련 이슈
#24