-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: [FN-222] 카드셋 조회시 좋아요/즐겨찾기 여부 반환 #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughCardSetDetailResponse 모델에 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
📒 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!
liked와bookmarked필드가 record에 적절하게 추가되었고, 팩토리 메서드 시그니처도 올바르게 업데이트되었습니다.Also applies to: 28-28, 38-39
src/main/java/project/flipnote/cardset/service/CardSetService.java (2)
177-178: 비인증 사용자에 대한 null 처리를 확인하세요.
userId가null일 경우(비인증 사용자),isLiked와isBookmarked메서드가 어떻게 동작할지 명확하지 않습니다. 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메서드에서도 좋아요/북마크 상태를 일관되게 반환하도록 업데이트되었습니다.
src/main/java/project/flipnote/cardset/service/CardSetService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 제거 필요
BookmarkServiceimport가 사용되지 않습니다. 이전 리뷰에서 지적된 순환 의존성 문제를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
📒 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: 순환 의존성 해결 확인이전 리뷰에서 지적된
CardSetService↔BookmarkService순환 의존성 문제가BookmarkReader를 도입하여 적절하게 해결되었습니다.
211-214: LGTM!
getCardSet과 일관된 방식으로 좋아요/즐겨찾기 상태를 조회하여 응답에 포함합니다. 수정 API는 인증이 필수이므로 userId가 null일 가능성이 낮습니다.
178-179: Confirm null userId handling in repository queries for anonymous usersSince
userIdis aLong(object type), it can be null when anonymous users access public card sets. Verify thatlikeReader.isLiked()andbookmarkReader.isBookmarked()handle null userId correctly. If not explicitly handled, these queries may produce unexpected results. Either ensure the repositories gracefully handle null userId (returningfalse), or validate upstream that userId is never null for these calls.
📝 변경 내용
✅ 체크리스트
💬 기타 참고 사항
Summary by CodeRabbit
릴리스 노트
✏️ Tip: You can customize this high-level summary in your review settings.