Skip to content

Conversation

@sweatbuckets
Copy link
Contributor

@sweatbuckets sweatbuckets commented Jan 30, 2026

  1. #⃣ 연관된 이슈
    • 관련 이슈를 명시해주세요.
    • 예: #이슈번호#이슈번호
  2. 📝 작업 내용
    • 이번 PR에서 작업한 내용을 간략히 설명해주세요.
    • 필요한 경우 이미지 첨부 가능.
  3. 📸 스크린샷 (선택)
    • 작업 내용을 시각적으로 표현할 스크린샷을 포함하세요.
  4. 💬 리뷰 요구사항 (선택)
    • 리뷰어가 특히 검토해주었으면 하는 부분이 있다면 작성해주세요.
    • 예: "메서드 XXX의 이름을 더 명확히 하고 싶은데, 좋은 아이디어가 있으신가요?"

Summary by CodeRabbit

  • New Features

    • Added new endpoints to retrieve a performer's show list with pagination support
    • Added new endpoint to access the user's personal shows list
  • Improvements

    • Enhanced photo album listing response format to provide complete pagination metadata, enabling better data navigation and more accurate total count information

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

The pull request migrates photo album pagination from Slice-based to Page-based approach across repository, service, and controller layers. Additionally, two new service methods are introduced: getPerformerShows and getMyShows.

Changes

Cohort / File(s) Summary
Pagination Migration - Data Layer
src/main/java/cc/backend/photoAlbum/repository/PhotoAlbumRepository.java
Repository method findByPerformerId return type changed from Slice<PhotoAlbum> to Page<PhotoAlbum>, enabling full pagination metadata instead of partial page information.
Pagination Migration & New Methods - Service Layer
src/main/java/cc/backend/photoAlbum/service/PhotoAlbumService.java, src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java
Service interface and implementation updated: getPhotoAlbumList return type changed from Slice<...> to PageResponse<...>, import refactored, and two new public methods added (getPerformerShows, getMyShows). Implementation refactored to use Page.map() and construct PageResponse instead of SliceImpl.
Pagination Migration - API Layer
src/main/java/cc/backend/photoAlbum/controller/PhotoAlbumController.java
Controller endpoint return type updated from ApiResponse<SliceResponse<...>> to ApiResponse<PageResponse<...>> for getPhotoAlbumList method.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 From slices small to pages whole,
Pagination finds its rightful role!
New shows emerge, the album sings,
With Page and Response—such grand things! 📸

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is incomplete. It contains only the template structure with placeholder text and no actual implementation details, related issue references, or summary of changes provided by the author. Fill in all required sections: specify related issue numbers, provide a detailed summary of changes (Slice to Page migration, new methods added), and optionally include screenshots or review requests.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: updating PageResponse to respond with the total photo album count, which aligns with the core changeset modifications across the controller, service, and repository layers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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 refactor/getPhotoAlbumByMember

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


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.

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

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/service/PhotoAlbumServiceImpl.java (1)

323-323: ⚠️ Potential issue | 🟠 Major

The in-code comment indicates pending Page refactoring that remains unaddressed.

The repository method findByMember_IdOrderByIdDesc is currently defined to return Slice<AmateurShow> (line 50 of AmateurShowRepository.java), matching the service implementation at line 323. However, the Korean comment //Page 방식 - 이름 수정 필요 ("Page method - name needs to be changed") explicitly documents that this should use Page instead. This refactoring aligns with the apparent PR goal: line 324 shows a separate manual call to countByMember_Id(memberId) to retrieve the total count, which would be provided automatically by Page<AmateurShow>. Update the repository method to return Page and adjust the service code accordingly to eliminate the redundant count query.

🧹 Nitpick comments (5)
src/main/java/cc/backend/photoAlbum/repository/PhotoAlbumRepository.java (1)

6-6: Unused import after migration.

The Slice import is no longer used in this file since findByPerformerId now returns Page. Consider removing it.

🧹 Remove unused import
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
-import org.springframework.data.domain.Slice;
 import org.springframework.data.jpa.repository.JpaRepository;
src/main/java/cc/backend/photoAlbum/controller/PhotoAlbumController.java (2)

5-5: Potentially unused import.

The SliceResponse import may no longer be needed after migrating to PageResponse. Verify and remove if unused.


12-12: Unused import from protobuf.

com.google.protobuf.Api appears to be an unused import. It's not referenced anywhere in this controller.

🧹 Remove unused import
-import com.google.protobuf.Api;
src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java (1)

414-416: Avoid using printStackTrace() for error logging.

Using e.printStackTrace() bypasses the application's logging framework. Replace with proper logger to maintain consistent logging and enable log aggregation.

♻️ Suggested fix using a logger

Add a logger field to the class:

private static final Logger log = LoggerFactory.getLogger(PhotoAlbumServiceImpl.class);

Then replace the catch block:

         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("Failed to merge schedule: start={}, end={}", start, end, e);
             return "";
         }

Note: If using Lombok, you can use @Slf4j annotation on the class instead.

src/main/java/cc/backend/photoAlbum/service/PhotoAlbumService.java (1)

8-8: Potentially unused import.

The Slice import may no longer be needed in this interface. Verify and remove if unused.

🧹 Remove unused import
 import org.springframework.data.domain.Pageable;
-import org.springframework.data.domain.Slice;
 import org.springframework.stereotype.Service;

@sweatbuckets sweatbuckets merged commit 758d0a3 into develop Jan 30, 2026
2 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