Skip to content

Conversation

@dungbik
Copy link
Contributor

@dungbik dungbik commented Dec 4, 2025

📝 변경 내용


✅ 체크리스트

  • 코드가 정상적으로 동작함
  • 테스트 코드 통과함
  • 문서(README 등)를 최신화함
  • 코드 스타일 가이드 준수

💬 기타 참고 사항

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능
    • 카드 세트 상세 정보에 사용자의 좋아요 및 북마크 상태 정보 추가
    • 모든 카드 세트 조회 및 상세 페이지에서 좋아요, 북마크 상태 표시
    • 사용자가 각 카드 세트에 대한 과거 상호작용 내역을 한눈에 확인 가능하도록 개선

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

@dungbik dungbik self-assigned this Dec 4, 2025
@dungbik dungbik added the enhancement New feature or request label Dec 4, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

Walkthrough

CardSetDetailResponse 모델에 likedbookmarked 필드를 추가하고, LikeReader와 BookmarkReader 서비스를 도입한 후 CardSetService에서 이들을 통합하여 카드셋 상세 응답에 사용자의 좋아요 및 북마크 상태를 포함시킵니다.

Changes

Cohort / File(s) Change Summary
모델 업데이트
src/main/java/project/flipnote/cardset/model/CardSetDetailResponse.java
likedbookmarked 부울 필드 추가. 정적 팩토리 메서드 서명을 from(CardSet, Long imageRefId)에서 from(CardSet cardSet, boolean liked, boolean bookmarked, Long imageRefId)로 변경하여 새 필드를 지원.
리더 서비스 추가
src/main/java/project/flipnote/like/service/LikeReader.java, src/main/java/project/flipnote/bookmark/service/BookmarkReader.java
LikeReader에 isLiked(Long userId, LikeTargetType targetType, Long targetId) 메서드 추가. 새로운 BookmarkReader 서비스 클래스 도입(LikeReader와 유사한 구조로 isBookmarked 메서드 제공).
서비스 통합
src/main/java/project/flipnote/cardset/service/CardSetService.java
LikeReader 및 BookmarkReader 의존성 주입 추가. getCardSet, updateCardSet 메서드에서 좋아요/북마크 상태를 계산하여 CardSetDetailResponse 생성 시 전달하도록 수정.
사소한 변경
src/main/java/project/flipnote/like/service/LikeService.java
LikeResponse 임포트 순서 재정렬(기능적 변화 없음).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • 주의 필요 사항:
    • CardSetDetailResponse 공개 API 서명 변경으로 인한 호출 지점 영향 범위 확인 필요
    • LikeReader.isLiked() 및 BookmarkReader.isBookmarked() 메서드의 저장소 쿼리 성능 고려
    • CardSetService의 getCardSet, updateCardSet, createCardSet 메서드에서 새로운 리더 호출 로직의 정확성 검증

Possibly related PRs

Suggested reviewers

  • stoneTiger0912

Poem

🐰 좋아요와 북마크 기능이 피어나고,
카드셋에 사용자의 마음이 담겨,
리더 서비스 둘이 손잡고,
응답 모델은 더욱 풍성해지네.
호이~

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 목적을 명확하게 설명합니다: 카드셋 조회 시 좋아요/즐겨찾기 여부를 반환하는 기능 추가.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/cardset-detail

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.

@dungbik dungbik changed the title Feat: 카드셋 조회시 좋아요/즐겨찾기 여부 반환 Feat: [FN-222] 카드셋 조회시 좋아요/즐겨찾기 여부 반환 Dec 4, 2025
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef1bd69 and 8ce4698.

📒 Files selected for processing (4)
  • src/main/java/project/flipnote/bookmark/service/BookmarkService.java (1 hunks)
  • src/main/java/project/flipnote/cardset/model/CardSetDetailResponse.java (3 hunks)
  • src/main/java/project/flipnote/cardset/service/CardSetService.java (7 hunks)
  • src/main/java/project/flipnote/like/service/LikeService.java (2 hunks)
⏰ 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
🔇 Additional comments (5)
src/main/java/project/flipnote/like/service/LikeService.java (1)

111-123: LGTM!

isLiked 메서드가 기존 패턴을 따르며 깔끔하게 구현되었습니다. Javadoc도 잘 작성되어 있습니다.

src/main/java/project/flipnote/bookmark/service/BookmarkService.java (1)

155-167: LGTM!

isBookmarked 메서드가 LikeService.isLiked와 동일한 패턴으로 일관성 있게 구현되었습니다.

src/main/java/project/flipnote/cardset/model/CardSetDetailResponse.java (1)

18-19: LGTM!

likedbookmarked 필드가 record에 적절하게 추가되었고, 팩토리 메서드 시그니처도 올바르게 업데이트되었습니다.

Also applies to: 28-28, 38-39

src/main/java/project/flipnote/cardset/service/CardSetService.java (2)

177-178: 비인증 사용자에 대한 null 처리를 확인하세요.

userIdnull일 경우(비인증 사용자), isLikedisBookmarked 메서드가 어떻게 동작할지 명확하지 않습니다. Repository의 existsBy...AndUserId(null) 호출 시 예상치 못한 결과가 발생할 수 있습니다.

비인증 사용자도 카드셋 상세 조회가 가능한지 확인이 필요합니다. 가능하다면, null 처리 로직 추가를 고려하세요:

boolean liked = userId != null && likeService.isLiked(userId, LikeTargetType.CARD_SET, cardSetId);
boolean bookmarked = userId != null && bookmarkService.isBookmarked(userId, BookmarkTargetType.CARD_SET, cardSetId);

210-213: LGTM!

updateCardSet 메서드에서도 좋아요/북마크 상태를 일관되게 반환하도록 업데이트되었습니다.

@dungbik dungbik merged commit f517a5d into develop Dec 4, 2025
2 of 3 checks passed
@dungbik dungbik deleted the feat/cardset-detail branch December 4, 2025 07:56
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: 0

🧹 Nitpick comments (1)
src/main/java/project/flipnote/cardset/service/CardSetService.java (1)

13-15: 사용하지 않는 import 제거 필요

BookmarkService import가 사용되지 않습니다. 이전 리뷰에서 지적된 순환 의존성 문제를 BookmarkReader로 해결한 것은 좋으나, 불필요한 import가 남아있습니다.

 import project.flipnote.bookmark.entity.BookmarkTargetType;
 import project.flipnote.bookmark.service.BookmarkReader;
-import project.flipnote.bookmark.service.BookmarkService;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ce4698 and 4bf7887.

📒 Files selected for processing (4)
  • src/main/java/project/flipnote/bookmark/service/BookmarkReader.java (1 hunks)
  • src/main/java/project/flipnote/cardset/service/CardSetService.java (7 hunks)
  • src/main/java/project/flipnote/like/service/LikeReader.java (1 hunks)
  • src/main/java/project/flipnote/like/service/LikeService.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/java/project/flipnote/like/service/LikeService.java
🧰 Additional context used
🧬 Code graph analysis (1)
src/main/java/project/flipnote/bookmark/service/BookmarkReader.java (2)
src/main/java/project/flipnote/like/service/LikeReader.java (1)
  • RequiredArgsConstructor (12-36)
src/main/java/project/flipnote/bookmark/service/BookmarkService.java (1)
  • RequiredArgsConstructor (31-155)
⏰ 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
🔇 Additional comments (5)
src/main/java/project/flipnote/bookmark/service/BookmarkReader.java (1)

9-25: LGTM!

LikeReader와 동일한 패턴을 따르는 깔끔한 구현입니다. 즐겨찾기 상태 조회를 위한 단일 책임 서비스로 적절하게 분리되어 있습니다.

src/main/java/project/flipnote/like/service/LikeReader.java (1)

22-35: LGTM!

기존 findByTargetAndUserId 패턴과 일관된 isLiked 메서드 추가입니다. Javadoc이 잘 작성되어 있습니다.

src/main/java/project/flipnote/cardset/service/CardSetService.java (3)

68-69: 순환 의존성 해결 확인

이전 리뷰에서 지적된 CardSetServiceBookmarkService 순환 의존성 문제가 BookmarkReader를 도입하여 적절하게 해결되었습니다.


211-214: LGTM!

getCardSet과 일관된 방식으로 좋아요/즐겨찾기 상태를 조회하여 응답에 포함합니다. 수정 API는 인증이 필수이므로 userId가 null일 가능성이 낮습니다.


178-179: Confirm null userId handling in repository queries for anonymous users

Since userId is a Long (object type), it can be null when anonymous users access public card sets. Verify that likeReader.isLiked() and bookmarkReader.isBookmarked() handle null userId correctly. If not explicitly handled, these queries may produce unexpected results. Either ensure the repositories gracefully handle null userId (returning false), or validate upstream that userId is never null for these calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants