-
Notifications
You must be signed in to change notification settings - Fork 1
[FIX] 사진첩 최신순, 페이지번호 기반 수정 #121
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
WalkthroughThe PR refactors the photo album module's pagination strategy from cursor-based to page-based pagination. This involves replacing Long cursorId parameters with int page parameters across the controller, service layer, repository, and DTOs, including method renames (e.g., getAllPhotoAlbumList → getAllRecentPhotoAlbumList) and updating response fields from nextCursor to nextPage. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/cc/backend/photoAlbum/repository/PhotoAlbumRepository.java (1)
33-34: Remove unusedfindNextAlbumsmethod.The
findNextAlbumsmethod implements cursor-based pagination and is not referenced anywhere in the codebase. After the refactoring to page-based pagination, this method is unused and should be removed.
🧹 Nitpick comments (2)
src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java (2)
169-169: Consider clarifying the "number" field semantics.The
numberfield is set tosinglePhotoAlbumDTOs.size(), which represents the count of items in the current page, not the total count across all pages. The field name could be ambiguous for API consumers. Consider renaming topageSizeorcurrentPageSizefor clarity, or document its meaning explicitly.
144-144: Remove unnecessary blank line.Minor style cleanup: the blank line at 144 can be removed.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/main/java/cc/backend/photoAlbum/controller/PhotoAlbumController.javasrc/main/java/cc/backend/photoAlbum/dto/PhotoAlbumResponseDTO.javasrc/main/java/cc/backend/photoAlbum/repository/PhotoAlbumRepository.javasrc/main/java/cc/backend/photoAlbum/service/PhotoAlbumService.javasrc/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java
🧰 Additional context used
🧬 Code graph analysis (3)
src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java (2)
k6-tests/scripts/search-performance-test.js (2)
page(124-124)size(125-125)src/main/java/cc/backend/photoAlbum/dto/PhotoAlbumResponseDTO.java (1)
PhotoAlbumResponseDTO(11-89)
src/main/java/cc/backend/photoAlbum/controller/PhotoAlbumController.java (1)
k6-tests/scripts/search-performance-test.js (2)
page(124-124)size(125-125)
src/main/java/cc/backend/photoAlbum/service/PhotoAlbumService.java (1)
k6-tests/scripts/search-performance-test.js (2)
page(124-124)size(125-125)
🔇 Additional comments (7)
src/main/java/cc/backend/photoAlbum/dto/PhotoAlbumResponseDTO.java (1)
62-62: LGTM! Field renames align with page-based pagination.The DTO field renames from
nextCursortonextPageare consistent across bothPerformerPhotoAlbumDTOandScrollMemberPhotoAlbumDTO, properly supporting the pagination strategy change.Also applies to: 84-84
src/main/java/cc/backend/photoAlbum/repository/PhotoAlbumRepository.java (1)
28-31: LGTM! Page-based query simplifies pagination logic.The new
findByPerformermethod correctly returnsPage<PhotoAlbum>and delegates ordering to thePageableparameter, which is passed withSort.by(Sort.Direction.DESC, "createdAt")from the service layer.src/main/java/cc/backend/photoAlbum/service/PhotoAlbumService.java (1)
16-16: LGTM! Service interface updated for page-based pagination.The method signatures correctly reflect the migration from cursor-based to page-based pagination, accepting
int pageandint sizeparameters.Also applies to: 19-19
src/main/java/cc/backend/photoAlbum/controller/PhotoAlbumController.java (2)
53-55: LGTM! Controller correctly implements page-based pagination.The pagination parameters have been successfully migrated from cursor-based (
Long cursorId) to page-based (int page) with appropriate defaults (defaultValue = "0"). The 0-indexed page numbering follows Spring Data's standard convention.Also applies to: 79-81
42-42: Documentation clarification looks good.The updated description clarifies that only
keyNamevalues from presigned URL calls should be passed inimageRequestDTOs. While unrelated to the pagination refactoring, this improves API documentation clarity.src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java (2)
118-173: LGTM! Page-based pagination implemented correctly.The refactored
getPhotoAlbumListmethod properly implements page-based pagination:
- Uses
PageRequestwith descendingcreatedAtsort for latest-first ordering (최신순)- Leverages
Page<PhotoAlbum>for built-in pagination metadata- Maintains N+1 query prevention with batch image lookup
- Correctly calculates
nextPagebased onhasNext()
284-323: LGTM! Consistent pagination implementation for recent albums.The
getAllRecentPhotoAlbumListmethod follows the same pattern asgetPhotoAlbumList:
- Consistent descending
createdAtordering- Uses
Pagefor metadata- Maintains efficient batch image lookup
- Proper
nextPagecalculation
|
Note Docstrings generation - SUCCESS |
Docstrings generation was requested by @sweatbuckets. * #121 (comment) The following files were modified: * `src/main/java/cc/backend/photoAlbum/controller/PhotoAlbumController.java` * `src/main/java/cc/backend/photoAlbum/repository/PhotoAlbumRepository.java` * `src/main/java/cc/backend/photoAlbum/service/PhotoAlbumService.java` * `src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java`
#이슈번호,#이슈번호Summary by CodeRabbit
nextPagefield instead ofnextCursor.✏️ Tip: You can customize this high-level summary in your review settings.