[FIX] 독서 타임라인 sort=LATEST/OLDEST 미지원으로 감상 기록 안 보이던 문제 수정 - #454
Merged
Conversation
책 상세의 감상 기록 란이 호출하는
GET /api/book/{personalBookId}/records/timeline?sort=LATEST 가
TimelineSortType(DESC/ASC만 정의)에 LATEST 가 없어 @RequestParam 바인딩
(Enum.valueOf)에 실패 → MethodArgumentTypeMismatchException(G003) → 타임라인
응답 자체가 실패해 "기록 저장 안 됨"처럼 보이던 버그.
- TimelineSortType: LATEST/OLDEST 추가(DESC/ASC 하위 호환 유지),
의미 기반 isAscending() 헬퍼 추가
- ReadingTimelineRepository: sort==ASC → sort.isAscending() (null-safe),
OLDEST 도 오름차순으로 매핑
- 컨트롤러/Api: defaultValue DESC→LATEST, Swagger 문서 동기화(B14)
- TimelineSortTypeTest: 해피(LATEST/OLDEST 바인딩·방향 매핑) + 더티(미정의 토큰 거부)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
PR 요약
이슈 번호
주요 변경 사항
TimelineSortType: FE가 보내는LATEST/OLDEST값 추가(DESC/ASC하위 호환 유지),의미 기반
isAscending()헬퍼 추가ReadingTimelineRepository: 정렬 방향 판정을sort == ASC→sort.isAscending()(null-safe)로변경해
OLDEST도 오름차순으로 매핑PersonalBookRecordController/PersonalBookRecordApi:sort기본값DESC→LATEST,Swagger 문서 동기화(B14)
TimelineSortTypeTest(신규): 해피(LATEST/OLDEST 바인딩·방향 매핑) + 더티(미정의 토큰 거부)참고 사항
GET /api/book/{personalBookId}/records/timeline?sort=LATEST의sort가TimelineSortType(기존 DESC/ASC만)에 없어@RequestParam바인딩(Enum.valueOf) 실패→
MethodArgumentTypeMismatchException(G003).DESC/ASC도 계속 허용되어 기존 호출 안 깨짐.compileJavaOK, 신규 회귀 테스트 OK,com.dokdok.book.*전체 테스트 OK.GET /{personalBookId}/records의sort는 SpringSort.Direction(DESC/ASC)이라, FE가 그쪽에도
LATEST를 보낸다면 동일 이슈가 발생할 수 있어 확인 필요.