fix: 기록 목록 조회 DTO 변경사항 반영#137
Conversation
Walkthrough기록 목록 조회와 관련된 DTO, 모델, UI 상태, 프레젠터, 컴포저블 함수 전반에 걸쳐 데이터 구조가 변경되었습니다. 기존의 content, page 기반 구조가 lastPage, totalResults, startIndex, itemsPerPage, readingRecords 등 명확한 필드로 대체되었고, author 필드가 추가되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Network as 네트워크
participant Mapper as 매퍼
participant Presenter as 프레젠터
participant UI as UI
Network->>Mapper: ReadingRecordsResponse(lastPage, totalResults, ... , readingRecords)
Mapper->>Presenter: ReadingRecordsModel(lastPage, totalResults, ... , readingRecords)
Presenter->>UI: BookDetailUiState(readingRecordsTotalCount, readingRecords)
UI->>UI: ReadingRecordsHeader(totalCount)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(해당 변경사항 내에서는 명확히 범위를 벗어난 기능적 코드 변경이 발견되지 않았습니다.) Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
easyhooon
left a comment
There was a problem hiding this comment.
오호 그런 깊은 뜻이 코드 이후에도 계속 봐바야겠네요
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/ReadingRecordsHeader.kt (1)
24-45: 파라미터 단순화 OK. 숫자 표기는 로케일 포맷 적용 권장표시되는 개수에 천단위 구분을 적용하면 가독성이 개선됩니다.
아래처럼 NumberFormat을 사용해 포맷팅을 적용해보세요.
- Text( - text = "$totalCount", + Text( + text = java.text.NumberFormat.getInstance().format(totalCount), color = ReedTheme.colors.contentBrand, style = ReedTheme.typography.headline2SemiBold, )core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt (1)
8-18: 필드 non-null 강제에 따른 디코딩 실패 리스크 확인 필요네트워크 DTO(ReadingRecordsResponse, ReadingRecord)의 모든 필드를 non-null로 선언하면, 백엔드 응답에서 일부 필드를 누락했을 때 즉시 디코딩 예외가 발생합니다. 계약이 100% 보장되는지 백엔드팀에 확인하거나, 기본값(default value) 설정을 검토해 주세요.
점검 대상 위치
- core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt (Lines 8–18)
- core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt ReadingRecord.author (Lines 44–45)
기본값 적용 예시 (선택):
- @SerialName("author") - val author: String, + @SerialName("author") + val author: String = "",feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (2)
79-109: initialLoad를 suspend + coroutineScope로 변경한 점 매우 적절
- 세 API를 async 병렬 실행하고, 하나라도 실패 시 예외를 전파하여 Error UI로 전환됩니다. PR 목적과 완전 일치합니다.
- 현재 구현으로도 명확하지만, 가독성을 위해 awaitAll을 고려할 수 있습니다(선택).
가능한 소소한 리팩터(선택):
val detail = async { ... },val seeds = async { ... },val records = async { ... }후await는 유지(가독성 OK) 또는awaitAll로 한 번에 대기(반환형 분기 필요).
173-176: 매개변수 네이밍 정합성(선택 리네임 제안)
loadMoreReadingRecords(startIndex: Int)에서page파라미터로 그대로 전달됩니다. 실제 의미는 "페이지 인덱스"이므로startIndex→pageIndex또는page로의 네이밍 일관성 개선을 제안드립니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt(2 hunks)core/model/src/main/kotlin/com/ninecraft/booket/core/model/ReadingRecordsModel.kt(2 hunks)core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt(2 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt(6 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt(1 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt(1 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/ReadingRecordsHeader.kt(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#46
File: feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/component/InfiniteLazyColumn.kt:83-95
Timestamp: 2025-07-14T00:46:03.843Z
Learning: seoyoon513과 팀은 한국어 주석을 선호하며, 한국어 주석을 영어로 번역하라는 제안을 하지 않아야 함
⏰ 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: ci-build
🔇 Additional comments (9)
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt (1)
225-231: DTO 변경 반영 적합 — totalCount 전달로 일관성 확보ReadingRecordsHeader에 totalCount를 전달하도록 바뀐 점이 상태와 모델 변경사항(페이지 정보 → 전체 개수)과 잘 맞습니다. 이 변경은 UI/Presenter/Model간 데이터 흐름을 단순화합니다.
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt (1)
30-33: off-by-one 우려 불필요: 페이지 인덱스 기준(1-based) 일관적 사용
BookDetailPresenter와 BookSearchPresenter 모두 START_INDEX(=1)부터 페이지 번호를 관리하고, loadMore 시currentStartIndex + 1로 다음 페이지를 요청합니다. 네트워크 응답의startIndex필드는 Presenter 로직에 직접 활용되지 않으므로 UI와 도메인 간 기준 불일치로 인한 오프바이원 오류는 발생하지 않습니다.Likely an incorrect or invalid review comment.
core/model/src/main/kotlin/com/ninecraft/booket/core/model/ReadingRecordsModel.kt (1)
4-9: 모델 구조 리팩터 적합 — 명시적 페이징 메타데이터와 author 필드 추가 OKcontent/page 제거 후 명시적 필드와 리스트 이름(readingRecords)로 정리된 점이 명확하고, author 추가도 요구사항에 부합합니다.
Also applies to: 23-24
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt (2)
194-195: ReadingRecord.author 매핑 추가 LGTM
- 네트워크 응답/모델에 추가된 author 필드를 정확히 전달하고 있습니다.
173-178: 기존 content/page 기반 참잔조 없음 확인됨
실행된 스크립트를 통해 더 이상content/page기반의 구(舊) 구현 참조는 남아있지 않음을 확인했습니다.
core/model/src/main/kotlin/.../LibraryModel.kt와 매퍼(ResponseToModel.kt)의PageInfoModel참조는 의도된 모델 구조입니다.- 네트워크(
ReedService.kt) 및 레포지토리(DefaultRecordRepository.kt,RecordRepository.kt) 레이어에서의page,size파라미터 사용은 새 페이지네이션 설계에 맞는 정상적인 호출입니다.feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (4)
38-38: coroutineScope 도입 LGTM
- 병렬 호출 실패를 상위로 전파하려는 설계 의도와 일치합니다. import 추가 적절합니다.
102-106: 신규 응답 필드 사용에 따른 상태 업데이트 LGTM
records.readingRecords로 리스트 교체,totalResults,lastPage로 카운트/마지막 페이지 플래그 반영이 정확합니다.
68-68: 총 개수 타입 일치 확인 완료 (Int)
ReadingRecordsResponse.totalResults와ReadingRecordsModel.totalResults모두 Int로 선언되어 있어,readingRecordsTotalCount: Int사용 시 타입 불일치나 오버플로우 우려가 없습니다.
257-257: UI 계층에readingRecordsPageInfo/PageInfoModel참조 없음 확인 완료
rg결과 UI 관련 소스에서는 해당 키워드가 검색되지 않았습니다.PageInfoModel사용은 core/data/impl 및 core/model 모듈에만 존재하며, UI 레이어 변경에는 영향이 없습니다.
그때 제정신으로 작업한게 아니라서..ㅎㅎ 엇 왜죽지? 하다가 발견한거라 제가 설명이 부족했습니다 🙇 |
🔗 관련 이슈
📙 작업 설명
🧪 테스트 내역
💬 추가 설명 or 리뷰 포인트
Summary by CodeRabbit
신규 기능
기능 개선
UI 변경