Skip to content

Conversation

@easyhooon
Copy link
Contributor

@easyhooon easyhooon commented Jan 15, 2026

🔗 관련 이슈

📙 작업 설명

  • 도서 상세 API 변경 사항 반영 및 V2 suffix 제거
  • 대표 감정을 산출하는 로직 및 컴포넌트 제거
  • Model 모듈내 model들 @Stable -> @Immutable로 어노테이션 적용 변경

🧪 테스트 내역 (선택)

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

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

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

  • 독서 기록 목록 조회 V2 API내에 독서 기록 DTO의 도서 정보가 누락되어 내려오는 문제가 있어 현재 기록 수정 화면등에 진입하면 책 정보가 제대로 기입되지 않는 문제가 있습니다.(수정 필요)
  • 서버에서 내려오는 감정관련 DTO가 v1/v2 의 간극때문에 타입이 나뉘어있는데 앱내 Domain Model에서는 EmotionCode를 통해 동일한 모델로 처리할 수 있도록 했습니다.(displayName 추가)
  • 대표 감정을 산출하는 로직이 서버로 옮겨짐에 따라, 네이티브에서 대표 감정을 산출하는 로직 및 컴포넌트 제거하였습니다.
  • Domain Model들 내부 프로퍼티들이 수정될 가능성이 없다고 판단되어 @Stable -> @Immutable로 변경했습니다. 이전에 개발시엔 이 두 어노테이션의 차이를 잘 몰라서, @Immutable사용이 조심스러워 사용하지 않았으나, 이제는 사용해도 된다고 판단하였습니다.

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 대표 감정(representativeEmotion)과 주요/상세 감정(primaryEmotion/detailEmotions) 표시 추가
  • Bug Fixes

    • 페이지 번호(null) 처리 개선 — 페이지 번호가 없는 기록도 안정적으로 표시
  • Refactor

    • 독서 기록 데이터 모델 통합 및 UI 연동 개선
    • 읽기 기록 관련 API 경로(v2) 및 응답 구조 정비

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Walkthrough

ReadingRecordModelV2를 ReadingRecordModel로 통합하고 관련 네트워크/모델/매퍼/UI를 V2 API 스펙(대표 감정(primaryEmotion), detailEmotions, nullable pageNumber)으로 맞춤; 다수의 안정성(stability) 덤프 및 일부 유틸/컴포저블(감정 분석 관련) 제거 및 Emotion → EmotionCode/PrimaryEmotion 모델 전환이 포함됩니다.

Changes

Cohort / File(s) 변경 사항
Core API / Repository
core/data/api/.../RecordRepository.kt
반환 타입을 Result<ReadingRecordModelV2>Result<ReadingRecordModel>로 통합 (post/getDetail/edit)
Core Network / Service
core/network/.../ReedService.kt, core/network/.../response/ReadingRecordsResponse.kt, core/network/.../response/RecordDetailResponse.kt, core/network/.../response/RecordRegisterResponse.kt
네트워크 모델 재정의: ReadingRecord/ReadingRecordV2 구조 변경(대표 감정 PrimaryEmotion, detailEmotions, pageNumber nullable); 일부 응답 모델(RecordDetailResponse, RecordRegisterResponse) 삭제; getReadingRecords 경로 v1 → v2
Core Data Impl / Mapper
core/data/impl/.../ResponseToModel.kt
매핑 로직 업데이트: ReadingRecordsResponse.toModel()에 representativeEmotion 추가; ReadingRecordV2→Model 매핑 경로로 이동; Category→EmotionModel 변환에서 EmotionCode.fromDisplayName 사용
Core Model
core/model/.../ReadingRecordsModel.kt, core/model/.../EmotionModel.kt, core/model/.../SeedModel.kt, 기타 모델 파일(...)
ReadingRecordsModel에 representativeEmotion 추가; ReadingRecordModel 구조 변경(감정 필드 → primaryEmotion/detailEmotions, pageNumber nullable); 여러 기존 V2/레거시 모델 제거; Emotion → EmotionCode(표시명 포함) 전환 및 관련 타입/어노테이션(@Stable@Immutable/@stable 위치 조정) 변경
Feature Detail (UI / Presenter / Components)
feature/detail/.../BookDetailPresenter.kt, BookDetailUi.kt, RecordItem.kt, CollectedSeeds.kt, SeedItem.kt, RecordDetailPresenter.kt, RecordDetailUi.kt, RecordDetailUiState.kt, BookDetailUiState.kt
UI/프리뷰 업데이트: emotionTags → primaryEmotion 사용으로 교체, representativeEmotion 필드 추가, pageNumber nullable 처리(표시 시 null 체크), CollectedSeeds 시그니처에 representativeEmotion 추가, 감정 렌더링/리소스/색 맵핑을 EmotionCode 기반으로 전환, 감정 분석 컴포저블 제거
Stability / Generated API Dumps
feature/*/*.stability, core/designsystem/stability 등 여러 stability 파일
여러 기능의 composable/스테이빌리티 진술 삭제 또는 파라미터/스테이빌리티 재분류(스킵불가 → non-skippable, STABLE → UNSTABLE)
Common / Utilities
core/common/.../EmotionAnalyzer.kt
EmotionAnalyzer 및 관련 분석 타입/함수 삭제 (감정 분석 로직 제거)
Imports / State 타입 이동
여러 파일 (AuthRepository, UserRepository, presenters 등)
AutoLoginState, OnboardingState, UserState 등 상태 타입들을 com.ninecraft.booket.core.modelcom.ninecraft.booket.core.model.state 패키지로 이동/임포트 변경
Design System
core/designsystem/.../EmotionCode.kt, core/designsystem/.../theme/Color.kt
Emotion → EmotionCode 기반 색/리소스 확장으로 이동; Etc* 명칭 → Other*로 리네이밍

Sequence Diagram(s)

sequenceDiagram
  participant UI as UI (Presenter/Composables)
  participant Repo as RecordRepository
  participant Service as ReedService (Retrofit)
  participant Network as Network (HTTP)
  participant Mapper as ResponseToModel

  UI->>Repo: 요청 (post/get/edit) with model (primaryEmotion, detailEmotions, pageNumber?)
  Repo->>Service: 호출 (api/v2/reading-records or record detail)
  Service->>Network: HTTP request
  Network-->>Service: HTTP response (ReadingRecordV2 / ReadingRecord with PrimaryEmotion)
  Service-->>Repo: raw response object
  Repo->>Mapper: response.toModel()
  Mapper-->>Repo: ReadingRecordModel (primaryEmotion, detailEmotions, pageNumber nullable)
  Repo-->>UI: Result<ReadingRecordModel>
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • seoyoon513

Poem

🐰 깡총깡총, 모델들이 모였네,
V2는 내려놓고 새 길을 탔네 🥕
감정은 한 송이로, 디테일은 꽃잎처럼,
페이지는 가벼워져서 nullable로 춤추고,
코드밭에 새싹이 돋았구나 — 토끼의 축복!

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.86% 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 제목은 API 변경 사항 반영과 V2 suffix 제거라는 주요 변경 내용을 명확하게 요약하고 있습니다.
Linked Issues check ✅ Passed PR은 #250 이슈의 요구사항인 도서 상세 화면 DTO/Model V2 이전 및 V2 suffix 제거를 완벽하게 충족합니다.
Out of Scope Changes check ✅ Passed 상태 클래스 이동, @Stable에서 @Immutable로 변경, EmotionCode 통일 등의 변경사항이 모두 연관된 API 마이그레이션 작업의 범위 내에 있습니다.

✏️ 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.

@easyhooon easyhooon marked this pull request as draft January 16, 2026 06:09
@easyhooon
Copy link
Contributor Author

독서 기록 목록 조회 V2 API내에 독서 기록 DTO의 도서 정보가 누락되어 내려오는 문제가 있어 현재 기록 수정 화면등에 진입하면 책 정보가 제대로 기입되지 않는 문제가 있습니다.(수정 필요)

@seoyoon513 이거 생각해보니, 화면내에 모든 기록들은 같은 도서 정보를 가지고 있으므로 도서 상세화면 진입시 받아온 도서 정보를 매핑해서 문제 해결할 수 있었습니다. 해당 커밋의 방법처럼 fallback 처리만 적용하면 문제 없이 정상 동작하여 작업 마무리 했습니다! 0575085

@easyhooon easyhooon marked this pull request as ready for review January 22, 2026 13:19
@seoyoon513
Copy link
Contributor

@easyhooon /seed/stats API에서 기타 감정 개수가 내려오지 않는 것 같은데 확인 된 부분일까요?

{
  "categories": [
    {
      "name": "따뜻함",
      "count": 0
    },
    {
      "name": "즐거움",
      "count": 2
    },
    {
      "name": "슬픔",
      "count": 2
    },
    {
      "name": "깨달음",
      "count": 0
    }
  ]
}

@Serializable
data class ReadingRecordsResponse(
@SerialName("representativeEmotion")
val representativeEmotion: PrimaryEmotion,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기록 없이 책만 등록했을 때, 해당 필드 null로 내려와서 null 체크 필요할 것 같습니다~!

Copy link
Contributor Author

@easyhooon easyhooon Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 그렇겠네요. 기록이 없을때가 있군요

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-490/feat] 도서 상세 API 변경 사항 반영 및 V2 suffix 제거

3 participants