[Feat] 프로필 및 온보딩 API 구현#31
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthrough프로필 드래프트 저장·조회, 온보딩 완료, 완료 프로필 조회·수정 API를 추가했습니다. 온보딩 단계와 프로필 응답 DTO, 사용자별 직무·지역 저장소 및 유니크 제약, 값 인코딩, 검증 오류·성공 상태와 통합 테스트를 함께 구현했습니다. Changes프로필 및 온보딩
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ProfileController
participant ProfileService
participant UserProfileRepository
participant UserRelationRepositories
Client->>ProfileController: PUT /api/profile/draft + JWT
ProfileController->>ProfileService: userId와 ProfileDraftRequest 전달
ProfileService->>UserProfileRepository: 프로필 생성 또는 드래프트 갱신
ProfileService->>UserRelationRepositories: 직무 카테고리·지역 교체
UserRelationRepositories-->>ProfileService: 저장된 관계 데이터 반환
ProfileService-->>ProfileController: ProfileDraftResponse 반환
ProfileController-->>Client: ApiResponse와 성공 상태 반환
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 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
🧹 Nitpick comments (1)
src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java (1)
313-347: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value
toProfileResponse는userRegionnull 체크가 없습니다.
toDraftResponse(285-290줄)는userRegion == null을 삼항으로 방어하지만,toProfileResponse는 바로userRegion.getRegion()을 호출합니다. 현재 흐름상 완료된 프로필은 region이 항상 존재하도록 강제되어 있어 즉시 문제가 되진 않지만, 일관성 있게 방어 코드를 넣는 것이 안전합니다.🤖 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/user/service/ProfileService.java` around lines 313 - 347, Update toProfileResponse to handle a null userRegion consistently with toDraftResponse: create a null-safe ProfileRegionResponse, returning null when userRegion is absent, and only access userRegion.getRegion() when it is non-null. Preserve the existing region mapping for present regions.
🤖 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/user/service/ProfileService.java`:
- Around line 83-97: Update saveDraft around replaceJobCategories and
replaceRegion so relationship replacement is skipped when the corresponding
request field is null, preserving existing job categories and region. Match
updateProfile’s null-handling behavior while continuing to replace each
relationship when its request value is provided.
---
Nitpick comments:
In
`@src/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.java`:
- Around line 313-347: Update toProfileResponse to handle a null userRegion
consistently with toDraftResponse: create a null-safe ProfileRegionResponse,
returning null when userRegion is absent, and only access userRegion.getRegion()
when it is non-null. Preserve the existing region mapping for present regions.
🪄 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
Run ID: b3c7e4dc-3b25-42b9-acba-baf41fa80565
📒 Files selected for processing (19)
src/main/java/com/leets7th/job_is_be/domain/user/controller/ProfileController.javasrc/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileDraftRequest.javasrc/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileDraftResponse.javasrc/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileJobCategoryResponse.javasrc/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileRegionResponse.javasrc/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileResponse.javasrc/main/java/com/leets7th/job_is_be/domain/user/dto/ProfileUpdateRequest.javasrc/main/java/com/leets7th/job_is_be/domain/user/entity/UserJobCategory.javasrc/main/java/com/leets7th/job_is_be/domain/user/entity/UserProfile.javasrc/main/java/com/leets7th/job_is_be/domain/user/entity/UserRegion.javasrc/main/java/com/leets7th/job_is_be/domain/user/enums/OnboardingStep.javasrc/main/java/com/leets7th/job_is_be/domain/user/repository/UserJobCategoryRepository.javasrc/main/java/com/leets7th/job_is_be/domain/user/repository/UserRegionRepository.javasrc/main/java/com/leets7th/job_is_be/domain/user/service/ProfileService.javasrc/main/java/com/leets7th/job_is_be/domain/user/service/ProfileValueCodec.javasrc/main/java/com/leets7th/job_is_be/global/config/JpaConfig.javasrc/main/java/com/leets7th/job_is_be/global/status/ErrorStatus.javasrc/main/java/com/leets7th/job_is_be/global/status/SuccessStatus.javasrc/test/java/com/leets7th/job_is_be/domain/user/controller/ProfileControllerIntegrationTest.java
jihoonkim501
left a comment
There was a problem hiding this comment.
수고많으셨습니다! 코드레빗 코멘트만 수정부탁드려요~!
#️⃣ 관련 이슈
closed #29
프로필 조회·수정과 온보딩 임시저장·완료 기능을 구현했습니다.
PR 유형
어떤 변경 사항이 있나요?
PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.
🧩 작업 내용
GET /api/profilePATCH /api/profileGET /api/profile/draftPUT /api/profile/draftPOST /api/profile/onboarding/completePROFILE,QUIZ,REVIEW관리📸 스크린샷(선택)
📣 To Reviewers
careerLevel이 없어도 가능하고, 온보딩 완료 시에는 필수로 검증합니다.user_profiles.career_level의NOT NULL제약 해제가 필요할 수 있습니다.Summary by CodeRabbit
새로운 기능
개선 사항