7주차 미션 [루크]#14
Open
yujining3827 wants to merge 58 commits into
Open
Conversation
Collaborator
|
미션 수고하셨습니다! |
Collaborator
KateteDeveloper
left a comment
There was a problem hiding this comment.
복합 cursor를 사용해서 동일한 별점 데이터 처리한 아이디어 너무 좋은 것 같습니다!!
yangjiae12
reviewed
May 18, 2026
Comment on lines
+40
to
+41
| @RequestParam(name = "page") Integer page, | ||
| @RequestParam(name = "size") Integer size |
Member
There was a problem hiding this comment.
page와 size가 쿼리 파라미터로 들어오므로, 음수나 0을 막기 위해 @validated + @min 검증을 추가하면 좋을 것 같습니다.
Comment on lines
+116
to
+117
| PageRequest pageRequest = | ||
| PageRequest.of(page, 3); |
Member
There was a problem hiding this comment.
페이지 크기 3이 하드코딩되어 있어, 상수로 분리하거나 요청값으로 받으면 추후 변경이 더 쉬울 것 같습니다.
|
|
||
| Slice<Review> reviewSlice; | ||
|
|
||
| if(sort.equals("stars")){ |
Member
There was a problem hiding this comment.
sort 값을 문자열로 직접 비교하고 있어, 허용 가능한 정렬 기준을 enum으로 관리하면 더 안전할 것 같습니다.
Comment on lines
+94
to
+101
| reviewSlice = | ||
| reviewRepository | ||
| .findByMemberIdAndIdLessThanOrderByIdDesc( | ||
| memberId, | ||
| idCursor, | ||
| pageable | ||
| ); | ||
| } |
Member
There was a problem hiding this comment.
별점이 같은 리뷰가 여러 개 있을 수 있어, stars만 cursor로 사용하면 데이터가 누락될 수 있습니다. stars + id를 함께 cursor로 사용하는 방식이 더 안정적일 것 같습니다.
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.
🚩 관련 이슈
📌 구현 결과
1. 내가 진행중인 미션 조회 API 구현
ParticipatedStatus.CHALLERGING상태의 미션만 조회하도록 구현2. 내가 생성한 리뷰 조회 API 구현
sort=id→ 최신 리뷰(ID DESC)sort=stars→ 별점 기준 정렬(STARS DESC)결과 상세 정리 page
3. Validation 및 예외 처리 구현
Request Body DTO에 Validation Annotation 적용
@NotBlank@NotNull@Valid를 통한 요청값 검증 적용GeneralExceptionAdvice에서MethodArgumentNotValidException처리 구현테스트 예시 :
❓ 리뷰 요청
동일한 별점 데이터가 많은 경우 문제가 생길까봐 (stars, id) 복합 cursor를 사용해봤는데,
현재 방식으로도 과제 요구사항 수준에서는 괜찮은지 궁금합니다.
🤔 질문
💬 기타 공유 사항
Validation테스트를 위해 빈 문자열 및 null 요청값에 대한 예외 응답도 함께 확인했습니다.