Skip to content

Feat: 이미지 변경 로직 간소화#4

Merged
dungbik merged 2 commits intomainfrom
feat/update-profile
Mar 12, 2026
Merged

Feat: 이미지 변경 로직 간소화#4
dungbik merged 2 commits intomainfrom
feat/update-profile

Conversation

@dungbik
Copy link
Contributor

@dungbik dungbik commented Mar 12, 2026

Summary by CodeRabbit

릴리스 노트

이번 업데이트는 내부 동작 개선에 중점을 두며 사용자 인터페이스나 공개 API에는 영향이 없습니다.

  • Refactor
    • 프로필 이미지 처리 로직 최적화: 새 이미지 등록 시 처리가 보다 효율적으로 변경되었습니다.
    • 기본 프로필 이미지 상수 가시성 조정(내부 사용성 향상).

@dungbik dungbik requested a review from stoneTiger0912 March 12, 2026 05:50
@dungbik dungbik self-assigned this Mar 12, 2026
@dungbik dungbik added the enhancement New feature or request label Mar 12, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2ee53c85-cdf9-46cf-9634-947d571bd7da

📥 Commits

Reviewing files that changed from the base of the PR and between b7eb55c and cf90bc4.

📒 Files selected for processing (2)
  • src/main/java/flipnote/user/user/application/UserService.java
  • src/main/java/flipnote/user/user/domain/User.java

Walkthrough

updateProfile에서 이미지 갱신 흐름을 조건부로 분기합니다: 요청에 imageRefId가 있으면 기본 이미지일 때 ActivateImage 호출, 그렇지 않으면 ChangeImage 호출. 응답의 imageRefId 대신 요청의 imageRefId를 UserUpdateResponse에 사용하도록 변경되었습니다. 오류 처리와 공개 시그니처는 유지됩니다.

Changes

Cohort / File(s) Summary
UserService 이미지 업데이트 로직
src/main/java/flipnote/user/user/application/UserService.java
updateProfile에서 이미지 처리 흐름을 변경: 요청의 imageRefId 기반으로 기본 이미지면 ActivateImage 호출, 아니면 ChangeImage 호출; 응답의 imageRefId 대신 요청의 imageRefId를 사용하도록 수정. 로컬 imageRefId 변수 제거.
도메인 상수 가시성 변경
src/main/java/flipnote/user/user/domain/User.java
DEFAULT_PROFILE_IMAGE_URL 상수의 가시성을 private에서 public으로 변경.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client
    participant UserSvc as UserService
    participant ImageSvc as ImageService
    participant UserRepo as UserRepository

    Client->>UserSvc: updateProfile(request with imageRefId)
    UserSvc->>UserRepo: load user
    alt current profile is DEFAULT_PROFILE_IMAGE_URL
        UserSvc->>ImageSvc: ActivateImage(request.imageRefId)
        ImageSvc-->>UserSvc: ActivateImageResponse(url, success)
    else current profile is not default
        UserSvc->>ImageSvc: ChangeImage(request.imageRefId)
        ImageSvc-->>UserSvc: ChangeImageResponse(url, success)
    end
    UserSvc->>UserRepo: save updated user (profileImageUrl from response)
    UserSvc-->>Client: UserUpdateResponse(imageRefId=request.imageRefId, profileImageUrl)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • stoneTiger0912

Poem

🐰 새 이미지로 깡충깡충,
요청의 ID를 안고 달리네.
응답은 조용히 뒷자리에,
변수 하나 줄고 길은 단순해,
당근 한 입, 배포는 준비 완료! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 풀 리퀘스트 제목은 변경사항의 주요 내용을 명확하게 반영하고 있습니다. 코드 요약에서 imageRefId 처리 로직을 간소화한 것이 주요 변경사항이며, 제목 '이미지 변경 로직 간소화'는 이를 적절히 나타냅니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/update-profile

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 and usage tips.

@dungbik dungbik merged commit 0986884 into main Mar 12, 2026
1 of 3 checks passed
@dungbik dungbik deleted the feat/update-profile branch March 12, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant