-
Notifications
You must be signed in to change notification settings - Fork 1
fix: V1 API와 response 구조가 호환되도록 독서 기록 목록 조회 api 수정 #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough독서 기록 목록 조회 API 응답 구조를 V1 API와 호환되도록 수정합니다. Page 객체를 구체적인 페이지네이션 필드(lastPage, totalResults, startIndex, itemsPerPage)로 분해하고, primaryEmotion을 representativeEmotion으로 명칭 변경합니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@apis/src/main/kotlin/org/yapp/apis/readingrecord/dto/response/ReadingRecordsWithPrimaryEmotionResponse.kt`:
- Around line 17-18: The DTO property totalResults in
ReadingRecordsWithPrimaryEmotionResponse is declared as Int but is populated
from Page.totalElements (Long), risking overflow; either change totalResults'
type to Long (update the `@Schema` example accordingly) so it matches
Page.totalElements, or if the API contract requires Int, clamp the value when
mapping (e.g., convert Page.totalElements to Int with a min(Page.totalElements,
Int.MAX_VALUE.toLong()) guard) and ensure the mapping code that sets
totalResults and any related consumers are updated to handle the chosen type.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
apis/src/main/kotlin/org/yapp/apis/readingrecord/dto/response/ReadingRecordsWithPrimaryEmotionResponse.ktapis/src/main/kotlin/org/yapp/apis/readingrecord/service/ReadingRecordServiceV2.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-validation
🔇 Additional comments (3)
apis/src/main/kotlin/org/yapp/apis/readingrecord/dto/response/ReadingRecordsWithPrimaryEmotionResponse.kt (2)
29-42: 팩토리 메서드 구조 변경 확인팩토리 메서드가 V1 API와 호환되는 응답 구조로 잘 변경되었습니다.
Page객체에서 필요한 페이지네이션 정보를 추출하여 명시적인 필드로 매핑하는 방식이 적절합니다.
20-21:startIndex필드명 유지는 적절함 - 스키마 설명이 명확하게 의도를 전달현재 코드는 의도대로 작동합니다.
startIndex는page.number(0부터 시작하는 페이지 번호)를 할당하며, 스키마 설명 "현재 페이지 번호 (0부터 시작)"가 이를 명확히 전달하고 있습니다. 필드명이 일반적인 오프셋 의미와 다르지만, 명시적인 설명으로 혼동을 방지하고 있어 변경이 불필요합니다.apis/src/main/kotlin/org/yapp/apis/readingrecord/service/ReadingRecordServiceV2.kt (1)
85-99: 팩토리 메서드 호출 업데이트 승인빈 결과와 일반 결과 두 경로 모두 새로운
ReadingRecordsWithPrimaryEmotionResponse.of()시그니처에 맞게 올바르게 업데이트되었습니다. 명명된 매개변수(representativeEmotion,page) 사용으로 가독성이 좋습니다.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
.../kotlin/org/yapp/apis/readingrecord/dto/response/ReadingRecordsWithPrimaryEmotionResponse.kt
Show resolved
Hide resolved
|


🔗 관련 이슈
📘 작업 유형
📙 작업 내역
Page<T>직접 노출 제거 →lastPage,totalResults,startIndex,itemsPerPage,readingRecords필드로 변경representativeEmotion으로 추가🧪 테스트 내역
🎨 스크린샷 또는 시연 영상 (선택)
✅ PR 체크리스트
💬 추가 설명 or 리뷰 포인트 (선택)
Summary by CodeRabbit
변경사항
✏️ Tip: You can customize this high-level summary in your review settings.