feat: 지원자 프로필 조회 API 통합 - #159
Conversation
지원자 프로필 화면을 그리는 데 API 를 3번 호출하던 것을 1번으로 줄인다. applicant 에 자기소개·역할·관심 카테고리·활동 통계를 넣고, 프로젝트 이력은 최신 5건과 hasNext 를 함께 담아 목록 API 와 같은 구조로 반환한다. 유저 검증을 하지 않는 조회 경로를 분리했다. 지원자 목록은 탈퇴 여부를 거르지 않아 검증이 있는 getPublicProfile 을 쓰면 목록에는 보이는 지원이 상세에서만 404 가 된다.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough지원 상세 응답에 지원자의 공개 프로필, 활동 통계, 최신 포트폴리오가 포함됩니다. 탈퇴한 지원자도 조회할 수 있습니다. 포트폴리오는 최대 5건을 반환하며, 추가 목록은 페이지네이션 API로 조회합니다. Changes지원자 프로필 통합
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant 요청자
participant RecruitmentApplicationService
participant UserService
participant PortfolioService
participant RecruitmentConverter
요청자->>RecruitmentApplicationService: 지원 상세 조회
RecruitmentApplicationService->>UserService: getPublicProfileOf(applicant)
UserService-->>RecruitmentApplicationService: 공개 프로필과 통계
RecruitmentApplicationService->>PortfolioService: getPortfoliosOf(applicantId, cursor, 5)
PortfolioService-->>RecruitmentApplicationService: 최신 포트폴리오와 페이지네이션
RecruitmentApplicationService->>RecruitmentConverter: 상세 응답 변환
RecruitmentConverter-->>요청자: 지원자 프로필 포함 상세 응답
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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: 1
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/com/slatto/domain/user/service/PortfolioService.java (1)
158-165: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift탈퇴 지원자의 포트폴리오 이력을 조회하도록 쿼리를 분리하세요.
UserService.withdraw는 해당 사용자의UserPortfolio를 soft-delete합니다. 그러나getPortfoliosOf는findActivePortfoliosByCursor를 호출합니다. 따라서 탈퇴 지원자의 지원 상세는 항상 빈portfolios를 반환합니다.이 메서드의 주석은 탈퇴 사용자의 이력을 반환한다고 명시합니다. 탈퇴로 soft-delete된 이력을 포함하는 전용 조회를 추가하세요. 사용자가 개별 삭제한 포트폴리오를 다시 노출하지 않도록 삭제 사유도 구분하세요. 탈퇴 지원자에 포트폴리오 6건을 만든 뒤 상세 응답의
items,hasNext,nextCursor를 검증하는 회귀 테스트를 추가하세요.🤖 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/slatto/domain/user/service/PortfolioService.java` around lines 158 - 165, Update PortfolioService.getPortfoliosOf to use a dedicated repository query that includes UserPortfolio records soft-deleted due to user withdrawal while excluding portfolios individually deleted by the user; add the corresponding repository query and validate pagination metadata (items, hasNext, and nextCursor) with a regression test covering six portfolios for a withdrawn applicant.
🤖 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/slatto/domain/recruitment/controller/RecruitmentApplicationController.java`:
- Around line 90-99: RecruitmentApplicationController의 지원자 프로필 API 안내에서 포트폴리오
API 호출 조건을 명확히 수정하세요. 최초 5건만 필요하면 applicant.portfolios의 상세 응답만 사용하고, 전체 프로젝트 이력이
필요할 때만 GET /users/{userId}/portfolios를 호출하도록 설명을 일관되게 정리하세요.
---
Outside diff comments:
In `@src/main/java/com/slatto/domain/user/service/PortfolioService.java`:
- Around line 158-165: Update PortfolioService.getPortfoliosOf to use a
dedicated repository query that includes UserPortfolio records soft-deleted due
to user withdrawal while excluding portfolios individually deleted by the user;
add the corresponding repository query and validate pagination metadata (items,
hasNext, and nextCursor) with a regression test covering six portfolios for a
withdrawn applicant.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bbbcf303-e752-4560-a81a-95547afac226
📒 Files selected for processing (8)
src/main/java/com/slatto/domain/recruitment/controller/RecruitmentApplicationController.javasrc/main/java/com/slatto/domain/recruitment/converter/RecruitmentConverter.javasrc/main/java/com/slatto/domain/recruitment/dto/RecruitmentApplicantListResponse.javasrc/main/java/com/slatto/domain/recruitment/dto/RecruitmentApplicationDetailResponse.javasrc/main/java/com/slatto/domain/recruitment/service/RecruitmentApplicationService.javasrc/main/java/com/slatto/domain/user/service/PortfolioService.javasrc/main/java/com/slatto/domain/user/service/UserService.javasrc/test/java/com/slatto/domain/recruitment/service/RecruitmentApplicationDetailIntegrationTest.java
| 지원자 프로필 화면에 필요한 값을 한 번에 반환한다. | ||
| 이 API 하나로 끝나므로 `GET /users/{userId}` 와 `GET /users/{userId}/portfolios` 를 | ||
| 따로 부르지 않아도 된다. | ||
|
|
||
| - 지원 정보 — `message`, `referenceLink`, `files` | ||
| - 지원자 프로필 — `applicant` 에 자기소개·지역·역할·관심 카테고리·활동 통계 | ||
| - 프로젝트 이력 — `applicant.portfolios` 에 최신 5건 | ||
|
|
||
| `applicant.portfolios` 는 목록 API 와 같은 구조이며 `hasNext` 가 `true` 면 | ||
| `GET /users/{userId}/portfolios` 로 이어서 조회한다. `nextCursor` 도 그대로 쓸 수 있다. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
포트폴리오 호출 안내를 조건부로 수정하세요.
Line 91-92는 포트폴리오 API를 호출할 필요가 없다고 설명합니다. Line 98-99는 hasNext가 true이면 같은 API를 호출하라고 설명합니다.
최초 5건만 필요한 경우에는 상세 응답만 사용하고, 전체 이력이 필요한 경우에는 포트폴리오 API를 호출한다고 명확히 설명하세요.
🤖 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/slatto/domain/recruitment/controller/RecruitmentApplicationController.java`
around lines 90 - 99, RecruitmentApplicationController의 지원자 프로필 API 안내에서 포트폴리오
API 호출 조건을 명확히 수정하세요. 최초 5건만 필요하면 applicant.portfolios의 상세 응답만 사용하고, 전체 프로젝트 이력이
필요할 때만 GET /users/{userId}/portfolios를 호출하도록 설명을 일관되게 정리하세요.
🔗 관련 이슈 (Related Issue)
Closes #158
📝 작업 내용
프론트가 지원자 프로필 화면 하나를 그리는 데 API를 3번 호출하던 것을 1번으로 줄였습니다.
지원 상세 응답의
applicant를 공개 프로필 수준으로 확장하고, 프로젝트 이력도 함께 담았습니다. 지원자 목록에는 자기소개 미리보기용bio를 추가했습니다.주요 변경 사항
applicant에 자기소개·역할·관심 카테고리·활동 통계 추가applicant.portfolios에 프로젝트 이력 최신 5건과hasNext포함applicant에 자기소개(bio) 추가상세 내용
1. 지원 상세 응답 통합
GET /api/v1/recruitments/{recruitmentId}/applications/{applicationId}하나로 지원자 프로필 화면이 완성됩니다.GET /users/{userId}applicantGET /users/{userId}/portfoliosapplicant.portfoliosapplicant의 노출 범위는 공개 프로필과 동일하게 맞췄습니다. 이메일은 본인 조회에만 있으므로 포함하지 않습니다.2. 프로젝트 이력은 최신 5건만
applicant.portfolios는 기존 포트폴리오 목록 API와 같은 구조입니다.hasNext가true면nextCursor를 그대로 넘겨GET /users/{userId}/portfolios로 이어서 조회할 수 있습니다.3. 탈퇴한 지원자 처리
지원자 목록은 탈퇴 여부를 거르지 않습니다. 검증이 들어간
getPublicProfile(Long)을 그대로 쓰면 목록에는 보이는 지원이 상세에서만 404가 되어, 공고 작성자가 목록에서 본 항목을 열 수 없게 됩니다.그래서 유저 검증을 하지 않는
getPublicProfileOf(Users)와getPortfoliosOf(...)를 분리했습니다. 탈퇴 시 닉네임·자기소개·프로필 이미지가 모두 익명화되므로 개인정보가 노출되지 않고, 포트폴리오도 함께 soft delete 되어 빈 목록으로 나갑니다.4. 지원자 목록 자기소개 추가
목록 조회 쿼리가 이미
join fetch ra.user로 지원자를 함께 불러오고 있어 추가 쿼리 없이 필드만 늘렸습니다.✅ PR 체크리스트
Summary by CodeRabbit
새 기능
접근 제어
개선 사항