[REFACTOR] 서재 검색 결과에 bookId 추가#280
Conversation
|
Warning Review limit reached
More reviews will be available in 37 minutes and 14 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
워크스루서재 검색 응답에 도서 식별자 bookId를 추가하고, ISBN 조회 쿼리를 Aladin 소스 도서로 제한합니다. DTO 필드 추가 후 변환 로직을 업데이트하고, Repository 메서드를 교체하여 중복 ISBN 문제를 해결합니다. 변경사항Library Search Result Enhancements
예상 코드 리뷰 난이도🎯 2 (Simple) | ⏱️ ~12 minutes 관련 가능성 있는 PR
제안 검토자
시🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
🧹 Nitpick comments (1)
src/main/java/app/nook/library/service/LibraryQueryService.java (1)
78-80: ⚡ Quick win빈 ISBN 목록은 조기 반환 처리해 주세요.
검색 결과가 0건일 때도 DB 쿼리를 호출하고 있어, 빈 입력은 바로
Set.of()를 반환하는 편이 더 안전하고 효율적입니다.♻️ 제안 코드
public Set<String> getOwnedIsbns(Long userId, List<String> isbns) { + if (isbns == null || isbns.isEmpty()) { + return Set.of(); + } return libraryRepository.findAladinIsbnsByUserIdAndIsbnIn(userId, isbns); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/app/nook/library/service/LibraryQueryService.java` around lines 78 - 80, The getOwnedIsbns method should early-return for empty or null ISBN input to avoid unnecessary DB calls: add a null/empty check at the start of getOwnedIsbns (before calling libraryRepository.findAladinIsbnsByUserIdAndIsbnIn) and return an immutable empty set (e.g., Set.of()) when isbns is null or isbns.isEmpty(); otherwise proceed to call libraryRepository.findAladinIsbnsByUserIdAndIsbnIn(userId, isbns).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/main/java/app/nook/library/service/LibraryQueryService.java`:
- Around line 78-80: The getOwnedIsbns method should early-return for empty or
null ISBN input to avoid unnecessary DB calls: add a null/empty check at the
start of getOwnedIsbns (before calling
libraryRepository.findAladinIsbnsByUserIdAndIsbnIn) and return an immutable
empty set (e.g., Set.of()) when isbns is null or isbns.isEmpty(); otherwise
proceed to call libraryRepository.findAladinIsbnsByUserIdAndIsbnIn(userId,
isbns).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0aa02aa3-7cc4-4eb3-85da-6d655fb22b2e
📒 Files selected for processing (7)
src/main/java/app/nook/book/converter/BookConverter.javasrc/main/java/app/nook/book/dto/BookResponseDto.javasrc/main/java/app/nook/library/repository/LibraryRepository.javasrc/main/java/app/nook/library/service/LibraryQueryService.javasrc/test/java/app/nook/controller/book/BookSearchControllerTest.javasrc/test/java/app/nook/library/repository/LibraryRepositoryTest.javasrc/test/java/app/nook/library/service/LibraryServiceTest.java
|
📄 작업 내용 요약
bookId필드 추가📎 Issue 번호
✅ 작업 목록
📝 기타 참고사항
Summary by CodeRabbit
릴리스 노트
New Features
Bug Fixes