[Feat]#103 캐릭터 수정 API 구현 및 프로필 조회 응답 개선 - #104
Conversation
|
Warning Review limit reached
Next review available in: 47 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 (1)
📝 WalkthroughWalkthrough프로필 응답에 Changes프로필 캐릭터 변경
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ProfileController
participant ProfileService
participant UserProfile
Client->>ProfileController: PATCH /api/users/me/profile/character
ProfileController->>ProfileController: Authorization 헤더에서 사용자 ID 추출
ProfileController->>ProfileService: 사용자 ID와 characterCode 전달
ProfileService->>ProfileService: characterCode 검증
ProfileService->>UserProfile: updateCharacterCode 호출
ProfileController-->>Client: UPDATE_CHARACTER_SUCCESS 응답
Possibly related issues
Possibly related PRs
Suggested labels: 🚥 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: 2
🤖 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/redo/domain/user/entity/UserProfile.java`:
- Around line 36-37: 기존 NULL 값을 기본 캐릭터 코드로 먼저 채우는 backfill 마이그레이션을 추가한 뒤,
user_profiles.character_code에 NOT NULL 제약을 적용하세요. UserProfile의 characterCode 컬럼
정의와 일치하도록 마이그레이션 실행 순서를 보장하고, 기존 비NULL 값은 유지하세요.
In `@src/main/java/com/redo/domain/user/service/ProfileService.java`:
- Line 116: Profile creation bypasses character-code validation, allowing
invalid values and misclassifying null persistence failures as duplicate
nicknames. Add a shared validation method using VALID_CHARACTER_CODES, invoke it
from both createProfile and updateCharacter before UserProfile.create or
character updates, and preserve the existing response behavior for valid codes
while rejecting null, empty, and unsupported values consistently.
🪄 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: 323fc8b8-5976-4178-a7e7-79288d847bed
📒 Files selected for processing (9)
Tasksrc/main/java/com/redo/domain/user/controller/ProfileController.javasrc/main/java/com/redo/domain/user/converter/ProfileConverter.javasrc/main/java/com/redo/domain/user/dto/ProfileReqDTO.javasrc/main/java/com/redo/domain/user/dto/ProfileResDTO.javasrc/main/java/com/redo/domain/user/entity/UserProfile.javasrc/main/java/com/redo/domain/user/exception/ProfileErrorCode.javasrc/main/java/com/redo/domain/user/exception/ProfileSuccessCode.javasrc/main/java/com/redo/domain/user/service/ProfileService.java
| @Column(name = "character_code", nullable = false, length = 50) | ||
| private String characterCode; |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 4 \
'character_code|user_profiles|ddl-auto|hibernate\.hbm2ddl\.auto|flyway|liquibase' \
--glob '*.sql' \
--glob '*.java' \
--glob '*.yml' \
--glob '*.yaml' \
--glob '*.properties' \
. || trueRepository: REDO-Team/Back
Length of output: 2821
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '== tracked migration/resources files ==\n'
git ls-files | rg '(^|/)(src/main/resources/.*\.(sql|yml|yaml|properties|xml)|src/main/java/.*/migrations/|src/main/resources/migrations/|src/main/resources/db/|db-migration|docker-compose|application)' || true
printf '\n== UserProfile relevant lines ==\n'
sed -n '1,80p' src/main/java/com/redo/domain/user/entity/UserProfile.java | cat -n
printf '\n== character_code usages ==\n'
rg -n 'characterCode|character_code' src/main src/test || true
printf '\n== JPA ddl-auto files ==\n'
rg -n 'ddl-auto|hibernate\.hbm2ddl\.auto|flyway\.enabled|liquibase\.enabled|flyway|liquibase' \
--glob '*.java' --glob '*.yml' --glob '*.yaml' --glob '*.properties' \
. || trueRepository: REDO-Team/Back
Length of output: 5577
기존 character_code 값을 채운 뒤 NOT NULL 제약을 적용하세요.
현재 ddl-auto: update만 있고 character_code 관련 마이그레이션은 없습니다. user_profiles.character_code가 새 제약으로 바뀌기 전에 기존 NULL 값을 허용된 기본 캐릭터 코드로 채우는 backfill migration을 추가해야 스키마 변경 시 제약 적용이 실패하지 않습니다.
🤖 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/redo/domain/user/entity/UserProfile.java` around lines 36 -
37, 기존 NULL 값을 기본 캐릭터 코드로 먼저 채우는 backfill 마이그레이션을 추가한 뒤,
user_profiles.character_code에 NOT NULL 제약을 적용하세요. UserProfile의 characterCode 컬럼
정의와 일치하도록 마이그레이션 실행 순서를 보장하고, 기존 비NULL 값은 유지하세요.
#️⃣연관된 이슈
📝작업 내용
스크린샷 (선택)
💬리뷰 요구사항(선택)
PR 전 필수 체크리스트
테스트 결과
Summary by CodeRabbit
새 기능
버그 수정