[Feat] #45 저장된 공고 조회 API 구현#48
Conversation
|
Warning Review limit reached
Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough저장한 공고 목록 조회 기능이 추가되었습니다. GET Changes저장 공고 목록 조회
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant SaveController
participant JobService
participant SavedJobRepository
participant UserActionRepository
Client->>SaveController: GET /api/saves + JWT/page/size/sort
SaveController->>JobService: getSavedJobs(userId, page, size, sort)
JobService->>SavedJobRepository: 저장 공고 페이지 및 집계 조회
JobService->>UserActionRepository: 지원 의도 클릭 여부 조회
JobService-->>SaveController: SavedJobListResponse
SaveController-->>Client: ApiResponse 성공 응답
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/java/com/leets7th/job_is_be/domain/job/repository/SavedJobRepository.java (1)
23-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win만료 판정 CASE 절 중복.
findByUserIdOrderBySavedDesc와findByUserIdOrderByDeadlineAsc가 동일한 만료 판정 CASE WHEN 블록을 그대로 복제하고 있습니다. 향후 만료 조건(예: 상태값 추가)이 변경될 때 한쪽만 수정되어 두 정렬 결과가 어긋날 위험이 있습니다.♻️ 공통 상수로 추출하는 예시
+public interface SavedJobRepository extends JpaRepository<SavedJob, Long> { + + String EXPIRED_ORDER_CASE = """ + CASE WHEN j.status <> com.leets7th.job_is_be.domain.job.enums.JobStatus.ACTIVE + OR (j.deadlineAt IS NOT NULL AND j.deadlineAt <= :now) + THEN 1 ELSE 0 END ASC + """;🤖 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/com/leets7th/job_is_be/domain/job/repository/SavedJobRepository.java` around lines 23 - 50, Extract the duplicated expiration CASE WHEN expression in SavedJobRepository into a shared constant and reuse it in both findByUserIdOrderBySavedDesc and findByUserIdOrderByDeadlineAsc, keeping each method’s remaining ORDER BY criteria unchanged.
🤖 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.
Inline comments:
In `@src/main/java/com/leets7th/job_is_be/domain/job/service/JobService.java`:
- Line 79: Update the apply-intent calculation in JobService’s
toSavedJobResponse flow to avoid calling
userActionRepository.existsByUserIdAndJobIdAndActionType for each SavedJob.
Collect the page’s job IDs, fetch matching apply-intent IDs once with an
IN-based repository query (returning Set<Long>), and use set membership while
mapping responses at lines 79 and 96–101.
- Around line 68-77: Update JobService.getSavedJobs to validate page and size
before constructing PageRequest: reject page values below 1 and size values
outside the supported positive maximum, throwing the appropriate
GeneralException with an ErrorStatus for each invalid input. Preserve the
existing 1-based-to-0-based page conversion and sorting behavior, and ensure
validation prevents Spring’s PageRequest IllegalArgumentException from reaching
clients.
---
Nitpick comments:
In
`@src/main/java/com/leets7th/job_is_be/domain/job/repository/SavedJobRepository.java`:
- Around line 23-50: Extract the duplicated expiration CASE WHEN expression in
SavedJobRepository into a shared constant and reuse it in both
findByUserIdOrderBySavedDesc and findByUserIdOrderByDeadlineAsc, keeping each
method’s remaining ORDER BY criteria unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 106dce53-0733-4617-8360-0df4418e3e83
📒 Files selected for processing (7)
src/main/java/com/leets7th/job_is_be/domain/job/controller/SaveController.javasrc/main/java/com/leets7th/job_is_be/domain/job/dto/SavedJobListResponse.javasrc/main/java/com/leets7th/job_is_be/domain/job/dto/SavedJobResponse.javasrc/main/java/com/leets7th/job_is_be/domain/job/enums/SavedJobSortType.javasrc/main/java/com/leets7th/job_is_be/domain/job/repository/SavedJobRepository.javasrc/main/java/com/leets7th/job_is_be/domain/job/service/JobService.javasrc/main/java/com/leets7th/job_is_be/global/status/SuccessStatus.java
#️⃣ 관련 이슈
closed #45
PR 유형
어떤 변경 사항이 있나요?
PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.
🧩 작업 내용
무한스크롤 대응을 위해 page/size 기반 페이지네이션(PageResponse) 사용
sort 쿼리 파라미터로 저장일순/마감임박순 선택 가능하도록 확장 가능한 구조
정렬 옵션과 무관하게 마감/만료된 공고는 항상 목록 하단에 위치 (JPQL CASE WHEN 1순위 정렬)
인증은 기존 JobInteractionController와 동일하게 @AuthenticationPrincipal Jwt 방식 사용 (구식 @RequestParam userId 방식 지양)
company fetch join으로 N+1 방지
📸 스크린샷(선택)
📣 To Reviewers
Summary by CodeRabbit