Skip to content

[Feat]#103 캐릭터 수정 API 구현 및 프로필 조회 응답 개선 - #104

Merged
jinha1665 merged 4 commits into
developfrom
feature/#103-character-update
Aug 2, 2026
Merged

[Feat]#103 캐릭터 수정 API 구현 및 프로필 조회 응답 개선#104
jinha1665 merged 4 commits into
developfrom
feature/#103-character-update

Conversation

@jinha1665

@jinha1665 jinha1665 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

#️⃣연관된 이슈

#103

📝작업 내용

피그마 프로필 수정 페이지 기준, 누락되어 있던 캐릭터 수정 기능 구현 및 프로필 조회 응답 구조 개선

스크린샷 (선택)

💬리뷰 요구사항(선택)

profileImageUrl, characterCode 둘 다 응답에 포함되도록 구조 변경.

PR 전 필수 체크리스트

  • 관련 이슈를 연결했습니다.
  • 로컬에서 정상 동작을 확인했습니다.
  • 필요한 테스트를 수행했습니다.
  • Swagger/API 명세를 업데이트했습니다.
  • 불필요한 로그 또는 주석을 제거했습니다.

테스트 결과

  • 단위 테스트
  • 통합 테스트
  • Swagger 테스트
  • Postman 테스트
  • 직접 실행 확인

Summary by CodeRabbit

  • 새 기능

    • 프로필 캐릭터를 변경할 수 있는 기능을 추가했습니다.
    • 프로필 정보에 캐릭터 코드가 표시됩니다.
  • 버그 수정

    • 프로필 이미지가 없는 경우에도 이미지 정보와 캐릭터 정보가 올바르게 구분되어 표시됩니다.
    • 유효하지 않은 캐릭터 코드 입력 시 안내 오류를 제공합니다.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jinha1665, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 51d8fa78-3844-4d8b-9b88-b98eaa404bde

📥 Commits

Reviewing files that changed from the base of the PR and between e6cc0a7 and 96af991.

📒 Files selected for processing (1)
  • src/main/java/com/redo/domain/user/service/ProfileService.java
📝 Walkthrough

Walkthrough

프로필 응답에 characterCode를 추가했습니다. 인증된 사용자가 캐릭터를 변경하는 PATCH API를 추가했습니다. 캐릭터 코드 "1"부터 "6"까지를 검증하고, 유효한 코드만 사용자 프로필에 저장합니다.

Changes

프로필 캐릭터 변경

Layer / File(s) Summary
프로필 응답 계약과 조회
src/main/java/com/redo/domain/user/dto/ProfileResDTO.java, src/main/java/com/redo/domain/user/converter/ProfileConverter.java, src/main/java/com/redo/domain/user/service/ProfileService.java
ProfileInfocharacterCode를 추가했습니다. 프로필 조회 시 이미지 URL과 캐릭터 코드를 별도로 전달합니다.
캐릭터 코드 검증과 저장
src/main/java/com/redo/domain/user/dto/ProfileReqDTO.java, src/main/java/com/redo/domain/user/entity/UserProfile.java, src/main/java/com/redo/domain/user/service/ProfileService.java, src/main/java/com/redo/domain/user/exception/ProfileErrorCode.java
UpdateCharacter 요청을 추가했습니다. "1"부터 "6"까지의 코드를 허용하고, 잘못된 값은 INVALID_CHARACTER_CODE로 거부합니다. 검증된 값은 UserProfile에 저장합니다.
캐릭터 변경 엔드포인트
src/main/java/com/redo/domain/user/controller/ProfileController.java, src/main/java/com/redo/domain/user/exception/ProfileSuccessCode.java
PATCH /api/users/me/profile/character 엔드포인트를 추가했습니다. 인증 실패를 처리하고 캐릭터 변경 성공 응답을 반환합니다.

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 응답
Loading

Possibly related issues

Possibly related PRs

  • REDO-Team/Back#40: 동일한 프로필 API와 ProfileController, ProfileConverter, ProfileResDTO, UserProfile, ProfileService 및 프로필 상태 코드를 수정합니다.
  • REDO-Team/Back#72: 프로필 업데이트 구성 요소를 수정하며, 이미지 업로드 기능과 캐릭터 변경 기능의 코드 연결점이 있습니다.

Suggested labels: ✨ feat

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 캐릭터 수정 API 구현과 프로필 조회 응답 개선이라는 변경 사항의 주요 내용을 정확하게 요약합니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3bb6311 and e6cc0a7.

📒 Files selected for processing (9)
  • Task
  • src/main/java/com/redo/domain/user/controller/ProfileController.java
  • src/main/java/com/redo/domain/user/converter/ProfileConverter.java
  • src/main/java/com/redo/domain/user/dto/ProfileReqDTO.java
  • src/main/java/com/redo/domain/user/dto/ProfileResDTO.java
  • src/main/java/com/redo/domain/user/entity/UserProfile.java
  • src/main/java/com/redo/domain/user/exception/ProfileErrorCode.java
  • src/main/java/com/redo/domain/user/exception/ProfileSuccessCode.java
  • src/main/java/com/redo/domain/user/service/ProfileService.java

Comment on lines +36 to 37
@Column(name = "character_code", nullable = false, length = 50)
private String characterCode;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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' \
  . || true

Repository: 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' \
  . || true

Repository: 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 값은 유지하세요.

Comment thread src/main/java/com/redo/domain/user/service/ProfileService.java
@jinha1665
jinha1665 merged commit d8ada0c into develop Aug 2, 2026
1 check passed
@jinha1665
jinha1665 deleted the feature/#103-character-update branch August 7, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant