[Feat] 하나의 공고에 대한 모의지원 순번 api#67
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds a GET endpoint /{mockApplyId}/sequence plus a response DTO, repository count queries, a service method that computes a 1-based sequence and total, and a unit test verifying the sequence computation. ChangesMock Apply Sequence Query
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/jobdri/jobdri_api/domain/mockapply/service/MockApplyService.java`:
- Around line 97-109: The current code loads all MockApply rows via
mockApplyRepository.findAllByUserIdAndJobPostingIdOrderByCreatedAtAscIdAsc and
scans in memory to compute sequence; replace this with two COUNT queries: use
mockApplyRepository.countByUserIdAndJobPostingId(validatedUser.getId(),
mockApply.getJobPosting().getId()) for totalCount, and compute sequence by
counting how many rows for that user+jobPosting have createdAt before
mockApply.getCreatedAt() (and include ties using id <= mockApply.getId() for
deterministic ordering) via a new repository method (e.g.
countByUserIdAndJobPostingIdAndCreatedAtBeforeOrCreatedAtEqualsAndIdLessThanEqual)
so you avoid fetching full rows and remove the in-memory loop over mockApplies.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 16b38ede-4424-4de8-bfd3-a93bd4d1e1cd
📒 Files selected for processing (5)
src/main/java/com/jobdri/jobdri_api/domain/mockapply/controller/MockApplyController.javasrc/main/java/com/jobdri/jobdri_api/domain/mockapply/dto/response/MockApplySequenceResponse.javasrc/main/java/com/jobdri/jobdri_api/domain/mockapply/repository/MockApplyRepository.javasrc/main/java/com/jobdri/jobdri_api/domain/mockapply/service/MockApplyService.javasrc/test/java/com/jobdri/jobdri_api/domain/mockapply/service/MockApplyServiceTest.java
✨ 어떤 이유로 PR를 하셨나요?
📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요
📸 작업 화면 스크린샷
🚨 관련 이슈 번호 [#27 ]
Summary by CodeRabbit