Skip to content

Conversation

@move-hoon
Copy link
Member

@move-hoon move-hoon commented Jan 14, 2026

🔗 관련 이슈

📘 작업 유형

  • ✨ Feature (기능 추가)
  • 🐞 Bugfix (버그 수정)
  • 🔧 Refactor (코드 리팩토링)
  • ⚙️ Chore (환경 설정)
  • 📝 Docs (문서 작성 및 수정)
  • ✅ Test (기능 테스트)
  • 🎨 style (코드 스타일 수정)

📙 작업 내역

  • V2 독서 기록 목록 조회 API 응답 구조를 V1과 동일하게 수정
  • Spring Page<T> 직접 노출 제거 → lastPage, totalResults, startIndex, itemsPerPage, readingRecords 필드로 변경
  • 대표 감정 필드명 representativeEmotion으로 추가

🧪 테스트 내역

  • 브라우저/기기에서 동작 확인
  • 엣지 케이스 테스트 완료
  • 기존 기능 영향 없음

🎨 스크린샷 또는 시연 영상 (선택)

기능 미리보기 기능 미리보기
기능 설명 기능 설명

✅ PR 체크리스트

  • 커밋 메시지가 명확합니다
  • PR 제목이 컨벤션에 맞습니다
  • 관련 이슈 번호를 작성했습니다
  • 기능이 정상적으로 작동합니다
  • 불필요한 코드를 제거했습니다

💬 추가 설명 or 리뷰 포인트 (선택)

  • ..

Summary by CodeRabbit

변경사항

  • 개선사항
    • 읽기 기록 조회 응답의 페이지네이션 정보 구조를 개선하여 더욱 명확한 형식으로 제공합니다.
    • 감정 관련 필드명을 표준화하여 API 일관성을 향상시켰습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@move-hoon move-hoon requested a review from minwoo1999 January 14, 2026 05:24
@move-hoon move-hoon self-assigned this Jan 14, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

Walkthrough

독서 기록 목록 조회 API 응답 구조를 V1 API와 호환되도록 수정합니다. Page 객체를 구체적인 페이지네이션 필드(lastPage, totalResults, startIndex, itemsPerPage)로 분해하고, primaryEmotion을 representativeEmotion으로 명칭 변경합니다.

Changes

Cohort / File(s) 변경 사항
API 응답 DTO 구조 개편
apis/src/main/kotlin/org/yapp/apis/readingrecord/dto/response/ReadingRecordsWithPrimaryEmotionResponse.kt
primaryEmotionrepresentativeEmotion로 필드명 변경. Page<ReadingRecordResponseV2> 객체를 lastPage, totalResults, startIndex, itemsPerPage, readingRecords로 분해하여 V1 API 호환성 확보. 팩토리 메서드 of() 시그니처 및 초기화 로직 업데이트
서비스 레이어 팩토리 메서드 호출 업데이트
apis/src/main/kotlin/org/yapp/apis/readingrecord/service/ReadingRecordServiceV2.kt
ReadingRecordsWithPrimaryEmotionResponse.of() 호출부의 매개변수를 변경된 메서드 시그니처에 맞게 업데이트. 기존 (primaryEmotion, records)에서 (representativeEmotion, page)로 수정

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 V1 API와의 응답 구조 호환성을 맞추기 위해 독서 기록 목록 조회 API를 수정한다는 변경사항을 명확하게 설명하고 있으며, 실제 코드 변경 내용과 일치합니다.
Linked Issues check ✅ Passed PR의 코드 변경사항이 #149의 목표(V1 API와 response 구조 호환, Page 제거, 필드 구조 변경)를 모두 충족하고 있습니다.
Out of Scope Changes check ✅ Passed 모든 코드 변경사항이 응답 DTO 필드명 및 구조 변경으로 제한되어 있으며, 링크된 이슈의 목표 범위 내에 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9e10c90 and 6579210.

📒 Files selected for processing (2)
  • apis/src/main/kotlin/org/yapp/apis/readingrecord/dto/response/ReadingRecordsWithPrimaryEmotionResponse.kt
  • apis/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 필드명 유지는 적절함 - 스키마 설명이 명확하게 의도를 전달

현재 코드는 의도대로 작동합니다. startIndexpage.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.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@move-hoon move-hoon merged commit a853025 into develop Jan 14, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-488/fix] V1 API와 response 구조가 호환되도록 독서 기록 목록 조회 api 수정

2 participants