Skip to content

[REFACTOR] 최근 포커스 조회 코드 리팩토링#276

Merged
kimdanha merged 1 commit into
develop-demofrom
feature/#274-recent-focus-api
May 18, 2026
Merged

[REFACTOR] 최근 포커스 조회 코드 리팩토링#276
kimdanha merged 1 commit into
develop-demofrom
feature/#274-recent-focus-api

Conversation

@kimdanha
Copy link
Copy Markdown
Contributor

@kimdanha kimdanha commented May 18, 2026

📄 작업 내용 요약

  • FocusTimeUtil.formatFocusTime 사용하도록 수정
  • FocusResponseDto/RecentFocusItem Dto에서 필요없는 필드 삭제

📎 Issue 번호

  • closed #

✅ 작업 목록

  • 기능 구현
  • 코드 리뷰 반영
  • 테스트 코드 작성
  • 문서 업데이트

📝 기타 참고사항

Summary by CodeRabbit

릴리즈 노트

  • 개선 사항
    • 최근 포커스 조회 응답에 도서 제목, 저자, 표지 이미지가 추가되어 더 상세한 정보 제공
    • 포커스 소요 시간 표시 형식 통일 및 개선

Review Change Stack

@kimdanha kimdanha self-assigned this May 18, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c93f3dab-2483-491f-9af7-25f2fc1a9b85

📥 Commits

Reviewing files that changed from the base of the PR and between 84174c6 and ca6fb38.

📒 Files selected for processing (4)
  • src/main/java/app/nook/focus/converter/FocusConverter.java
  • src/main/java/app/nook/focus/dto/FocusResponseDto.java
  • src/test/java/app/nook/controller/focus/FocusControllerTest.java
  • src/test/java/app/nook/focus/service/FocusQueryServiceTest.java
💤 Files with no reviewable changes (3)
  • src/test/java/app/nook/focus/service/FocusQueryServiceTest.java
  • src/main/java/app/nook/focus/dto/FocusResponseDto.java
  • src/test/java/app/nook/controller/focus/FocusControllerTest.java

개요

최근 포커스 조회 응답의 RecentFocusItem 레코드를 리팩토링하여 libraryId와 durationSec 필드를 제거하고 책 정보 필드를 추가했습니다. 기간 포맷팅을 중앙 유틸로 통합하고 모든 테스트와 문서를 새 스키마에 맞게 조정했습니다.

변경 사항

최근 포커스 응답 DTO 리팩토링

레이어 / 파일 요약
RecentFocusItem 레코드 스키마 변경
src/main/java/app/nook/focus/dto/FocusResponseDto.java
RecentFocusItem 레코드에서 libraryId와 durationSec을 제거하고 bookId, bookTitle, author, coverImageUrl, startedAt, endedAt, durationText를 포함하도록 컴포넌트 구조를 업데이트했습니다.
포커스 변환기의 기간 포맷팅 통합
src/main/java/app/nook/focus/converter/FocusConverter.java
FocusTimeUtil을 임포트하여 FocusEnd와 RecentFocusItem 변환에서 로컬 formatDuration 대신 FocusTimeUtil.formatFocusTime을 사용하도록 변경했습니다. null 값은 0으로 치환합니다.
테스트 및 API 문서화 업데이트
src/test/java/app/nook/controller/focus/FocusControllerTest.java, src/test/java/app/nook/focus/service/FocusQueryServiceTest.java
GetRecentFocuses 테스트의 더미 데이터와 검증을 새 스키마에 맞게 조정했으며, REST Docs 응답 필드 정의에서 libraryId와 durationSec을 제거했습니다.

예상 코드 리뷰 노력

🎯 2 (Simple) | ⏱️ ~10분

🐰 필드를 다듬고 정렬하여,
오래된 것들은 치우고 새것들을 담아,
포맷터는 한곳으로 모아
깨끗하게 다시 태어난 응답 구조!
스키마도 노래해

🚥 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 제목이 변경 사항의 주요 내용을 명확히 반영하고 있습니다. 최근 포커스 조회 관련 코드 리팩토링이라는 핵심 의도가 잘 전달되어 있습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/#274-recent-focus-api

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.

@JiwonLee42
Copy link
Copy Markdown
Contributor

Overall Project 66.83% -0.04% 🍏
Files changed 80% 🍏

File Coverage
FocusConverter.java 94.26% -3.28% 🍏

@kimdanha
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kimdanha kimdanha merged commit 6d99188 into develop-demo May 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants