Skip to content

프론트에서 리스트 개수 정할 수 있게 변동#75

Merged
BDOR665 merged 4 commits intodevelopfrom
feature/#73-recruitment-list-count-front
Aug 6, 2025
Merged

프론트에서 리스트 개수 정할 수 있게 변동#75
BDOR665 merged 4 commits intodevelopfrom
feature/#73-recruitment-list-count-front

Conversation

@BDOR665
Copy link
Contributor

@BDOR665 BDOR665 commented Aug 6, 2025

🚀 What’s this PR about?

  • 프론트에서 전달한 size 파라미터를 활용해, 한 페이지에 보여주는 공고 개수를 유동적으로 조절할 수 있도록 기능을 확장

🛠️ What’s been done?

  • listRecruitments 서비스 메서드에서 int size 파라미터 추가
  • 컨트롤러에서 @RequestParam(defaultValue = "80") int size 적용
  • 프론트에서 ?size=40 등으로 요청 시 해당 개수만큼 응답되도록 개선
  • 기존 기본값은 유지되며, 필요 시 요청으로 조절 가능

🧪 Testing Details

  • RecruitmentService 테스트 케이스에 size 파라미터 추가 및 로직 업데이트

👀 Checkpoints for Reviewers

📚 References & Resources

🎯 Related Issues

  • close#73

Summary by CodeRabbit

  • 신규 기능

    • 채용 목록 조회 시 페이지 크기를 사용자가 지정할 수 있도록 개선되었습니다. 기본 페이지 크기는 80으로 설정됩니다.
  • 문서

    • API 문서에 페이지 크기(size) 파라미터 및 기본값이 반영되었습니다.
  • 테스트

    • 페이지 크기(size) 파라미터 추가에 따라 관련 테스트 코드가 업데이트되었습니다.

BDOR665 added 3 commits August 6, 2025 11:45
- RecruitmentService 페이징 기능 확장: size 파라미터 추가로 페이지 크기 조정 가능
- 관련 Controller, Repository, 주석 및 설명 수정
- Repository 조건문에서 불필요한 공백 제거 및 코드 포맷팅 수정
- RecruitmentService 테스트 케이스에 size 파라미터 추가 및 로직 업데이트
- 코드 정리 및 관련 주석 수정
@BDOR665 BDOR665 self-assigned this Aug 6, 2025
@BDOR665 BDOR665 linked an issue Aug 6, 2025 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Aug 6, 2025

Walkthrough

리크루트 목록 조회 API의 페이지네이션 로직이 변경되어, 기존 고정 페이지 크기에서 클라이언트가 페이지 크기(size)를 지정할 수 있도록 개선되었습니다. 이에 따라 컨트롤러, 서비스, 테스트 코드의 메서드 시그니처가 변경되었고, 레포지토리에서는 일부 불필요한 메서드가 삭제되었습니다.

Changes

Cohort / File(s) Change Summary
Controller: 페이지네이션 파라미터 확장
src/main/java/org/example/hugmeexp/domain/recruitment/controller/RecruitmentController.java
listRecruitments 메서드에 size 파라미터 추가 및 API 문서 주석 수정, 서비스 호출부 변경
Repository: 불필요 메서드 제거 및 쿼리 주석 보강
src/main/java/org/example/hugmeexp/domain/recruitment/repository/RecruitmentRepository.java
findIdsBySearchConditions, findByIds 메서드 및 관련 쿼리 삭제, 메인 쿼리 포맷 및 주석 보강
Service: 페이지네이션 파라미터 확장
src/main/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentService.java
listRecruitments 메서드에 size 파라미터 추가, Javadoc 수정
Test: 서비스 시그니처 변경 반영
src/test/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentServiceTest.java
테스트 내 listRecruitments 호출부에 size 파라미터 추가, 관련 mock 및 검증 코드 수정

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RecruitmentController
    participant RecruitmentService
    participant RecruitmentRepository

    Client->>RecruitmentController: GET /recruitments?page=&size=
    RecruitmentController->>RecruitmentService: listRecruitments(cond, page, size)
    RecruitmentService->>RecruitmentRepository: (쿼리, page, size)
    RecruitmentRepository-->>RecruitmentService: Page<RecruitmentResponseDTO>
    RecruitmentService-->>RecruitmentController: Page<RecruitmentResponseDTO>
    RecruitmentController-->>Client: Response<List<RecruitmentResponseDTO>>
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Possibly related PRs

Suggested labels

기능 개발

Suggested reviewers

  • Roysung0625
  • seongjunin98
  • jam9582
  • hueyjeong
  • Cori1304-Seong

Poem

🐇
페이지 크기, 이제 네 맘대로
토끼도 깡총, 리스트도 늘어나고
컨트롤러, 서비스, 테스트도 척척
쿼리도 다이어트, 더 가볍게 hop!
개발자와 사용자 모두 웃는 봄

— 코드밭 토끼 드림 🥕

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02f8312 and 796107d.

📒 Files selected for processing (1)
  • src/main/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentService.java (1 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 (2)
src/main/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentService.java (2)

63-63: Javadoc 업데이트가 올바르게 수행되었습니다.

새로 추가된 size 매개변수에 대한 설명이 명확하고 적절합니다.


66-66: 메서드 시그니처 변경이 올바르게 구현되었습니다.

동적 페이지 크기를 지원하기 위해 size 매개변수가 적절히 추가되었습니다.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#73-recruitment-list-count-front

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

Unit Test Results

320 tests   294 ✔️  19s ⏱️
  45 suites    26 💤
  45 files        0

Results for commit 796107d.

♻️ This comment has been updated with latest results.

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: 3

🔭 Outside diff range comments (1)
src/test/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentServiceTest.java (1)

665-667: 다양한 페이지 크기에 대한 테스트 케이스 추가를 고려해보세요.

현재 모든 테스트에서 size = 80을 사용하고 있습니다. 다양한 페이지 크기(예: 10, 20, 100)에 대한 테스트를 추가하여 동적 페이지 크기 기능을 더 철저히 검증할 수 있습니다.

다음과 같은 테스트 케이스를 추가하는 것을 고려해보세요:

@Test
@DisplayName("다양한 페이지 크기로 채용 공고 조회 테스트")
void listRecruitments_DifferentPageSizes_ShouldReturnCorrectSize() {
    // Given
    RecruitmentSearchConditionDTO condition = RecruitmentSearchConditionDTO.builder().build();
    int[] pageSizes = {10, 20, 50, 100};
    
    for (int pageSize : pageSizes) {
        // When & Then - 각 페이지 크기에 대해 테스트
    }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78d7905 and 02f8312.

📒 Files selected for processing (4)
  • src/main/java/org/example/hugmeexp/domain/recruitment/controller/RecruitmentController.java (2 hunks)
  • src/main/java/org/example/hugmeexp/domain/recruitment/repository/RecruitmentRepository.java (3 hunks)
  • src/main/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentService.java (1 hunks)
  • src/test/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentServiceTest.java (18 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 (17)
src/test/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentServiceTest.java (3)

210-218: 테스트 코드가 포괄적으로 업데이트되었습니다.

모든 listRecruitments 호출이 새로운 size 매개변수를 포함하도록 일관성 있게 수정되었습니다. 목 객체 생성과 검증 로직도 올바르게 업데이트되어 변경된 API에 대한 테스트 커버리지가 유지되었습니다.

Also applies to: 235-243, 265-273, 297-305, 325-333, 353-361, 381-389, 405-429, 447-465, 485-519, 544-601, 1102-1110, 1129-1137, 1163-1171


210-218: 테스트 메서드들이 새로운 메서드 시그니처에 맞게 올바르게 업데이트되었습니다.

모든 테스트에서:

  • size 변수를 80으로 일관되게 설정
  • 모의 페이지 객체 생성 시 동적 size 값 사용
  • 서비스 메서드 호출 시 size 파라미터 전달
  • 검증 로직에서 페이지 크기를 올바르게 확인

테스트 커버리지가 새로운 기능에 맞게 잘 유지되었습니다.

Also applies to: 235-243, 265-273, 297-305, 325-333, 353-361, 381-389, 405-429, 447-465, 485-519, 544-601, 1102-1110, 1129-1137, 1163-1171


210-225: 테스트가 새로운 메서드 시그니처에 맞게 올바르게 업데이트되었습니다.

size 매개변수 추가와 관련된 모든 변경사항이 일관되게 적용되었습니다.

src/main/java/org/example/hugmeexp/domain/recruitment/controller/RecruitmentController.java (4)

40-40: 컨트롤러 페이지네이션 로직이 올바르게 개선되었습니다.

새로운 size 매개변수가 추가되어 클라이언트가 페이지 크기를 동적으로 제어할 수 있게 되었습니다. API 문서, 매개변수 어노테이션, 서비스 호출이 모두 일관성 있게 업데이트되었으며 기본값을 통해 하위 호환성도 보장됩니다.

Also applies to: 59-62


40-40: 컨트롤러의 페이지네이션 로직이 올바르게 개선되었습니다.

변경사항:

  • API 문서에 새로운 size 파라미터 설명 추가
  • 기본값 80으로 설정된 size 요청 파라미터 추가
  • 서비스 메서드 호출 시 동적 페이지 크기 전달

프론트엔드에서 페이지 크기를 유연하게 제어할 수 있도록 하는 요구사항을 정확히 구현했습니다.

Also applies to: 59-62


40-40: API 문서가 새로운 페이지네이션 매개변수를 정확히 반영했습니다.

기본값 80과 size 매개변수에 대한 문서화가 명확합니다.


59-62: 페이지네이션 매개변수와 서비스 호출이 올바르게 구현되었습니다.

size 매개변수의 기본값 설정과 서비스 계층으로의 전달이 적절합니다.

src/main/java/org/example/hugmeexp/domain/recruitment/repository/RecruitmentRepository.java (7)

27-28: 문서화가 개선되었습니다.

사용자가 지도에서 선택한 사각형 범위 내 공고 필터링에 대한 설명 코멘트가 추가되어 코드의 가독성이 향상되었습니다.


50-53: 코드 포맷팅이 개선되었습니다.

OR 조건 뒤의 불필요한 공백이 제거되어 코드 일관성이 향상되었습니다.

Also applies to: 88-91


27-28: 지리적 필터링 기능에 대한 명확한 주석이 추가되었습니다.

사용자가 지도에서 선택한 사각형 영역 내의 공고를 필터링한다는 기능 설명이 추가되어 코드 이해도가 향상되었습니다.


50-53: 쿼리 포맷팅이 개선되었습니다.

OR 조건문 뒤의 불필요한 공백이 제거되어 코드 일관성이 향상되었습니다.

Also applies to: 88-90


27-28: 지도 범위 필터링에 대한 유용한 주석이 추가되었습니다.

사용자가 지도에서 선택한 사각형 범위 내의 공고를 필터링한다는 비즈니스 로직이 명확히 설명되었습니다.


50-53: 쿼리 포맷팅이 개선되었습니다.

OR 조건 뒤의 불필요한 공백이 제거되어 코드 가독성이 향상되었습니다.


88-91: count 쿼리의 포맷팅도 일관되게 개선되었습니다.

메인 쿼리와 동일한 포맷팅 개선이 적용되어 일관성이 유지되었습니다.

src/main/java/org/example/hugmeexp/domain/recruitment/service/RecruitmentService.java (3)

66-68: 메서드 시그니처와 구현이 올바르게 업데이트되었습니다.

size 파라미터 추가로 동적 페이지 크기 제어가 가능해졌습니다. PageRequest 생성 시 파라미터를 올바르게 사용하고 있습니다.


63-63: 자바독 주석이 새로운 매개변수를 정확히 문서화했습니다.

새로운 size 매개변수와 기본값에 대한 문서화가 명확합니다.


66-66: 메서드 시그니처가 올바르게 업데이트되었습니다.

size 매개변수 추가로 동적 페이지 크기 제어가 가능해졌습니다.

- RecruitmentService 주석 수정: 페이징 크기 가이드라인을 `size` 파라미터로 명확화
@BDOR665 BDOR665 merged commit fd7647a into develop Aug 6, 2025
3 checks passed
@BDOR665 BDOR665 deleted the feature/#73-recruitment-list-count-front branch August 6, 2025 05:21
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.

[기능] 프론트에서 리스트 개수 정할 수 있게 변동

3 participants

Comments