Skip to content

refactor: 유저 정보 조회 수정#155

Merged
xoruddl merged 1 commit into
developfrom
154-유저-정보-조회-수정
Aug 27, 2025

Hidden character warning

The head ref may contain hidden characters: "154-\uc720\uc800-\uc815\ubcf4-\uc870\ud68c-\uc218\uc815"
Merged

refactor: 유저 정보 조회 수정#155
xoruddl merged 1 commit into
developfrom
154-유저-정보-조회-수정

Conversation

@xoruddl
Copy link
Copy Markdown
Member

@xoruddl xoruddl commented Aug 27, 2025

📝 개요
이번 PR의 핵심 내용을 한 줄로 요약해 주세요.

💻 작업 내용
이번 PR에서 작업한 내용을 상세히 설명해 주세요.

작업 내용 1
작업 내용 2
...

✅ PR 체크리스트
PR을 보내기 전에 아래 체크리스트를 확인해 주세요.

커밋 메시지는 포맷에 맞게 작성했나요?
스스로 코드를 다시 한번 검토했나요?
관련 이슈를 연결했나요?
빌드 및 테스트가 로컬에서 성공했나요?

🔗 관련 이슈
이번 PR과 관련된 이슈 번호를 기재해 주세요. 예: Closes #154

스크린샷 (선택)
UI 변경 사항이 있다면 스크린샷을 첨부해 주세요.

Summary by CodeRabbit

  • 신기능
    • 프로필 이미지 표시 로직 개선: 가장 낮은 슬롯 번호의 정원 아바타를 우선 사용하고, 이미지가 없을 경우 기본 이미지로 자동 대체하여 일관된 표시를 제공합니다.
    • 프로필 조회 시 정원/아바타 기반의 이미지 결정으로 사용자별 대표 이미지가 더 정확하게 반영됩니다.

@xoruddl xoruddl linked an issue Aug 27, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

사용자 프로필 조회 시, 리포지토리에 사용자-정원-아바타-아바타마스터를 즉시 로딩하는 메서드를 추가하고, 서비스에서 프로필 이미지 결정 로직을 정원의 최소 slotNumber 기반으로 재구성하여 아바타/마스터/사용자 이미지 URL 순으로 폴백하도록 변경했습니다.

Changes

Cohort / File(s) Change Summary
Repository: eager fetch for user gardens/avatars
src/main/java/com/example/cp_main_be/domain/member/user/domain/repository/UserRepository.java
새 메서드 findByIdWithGardensAndAvatars(Long userId) 추가. JPQL @Query로 사용자와 연관된 gardens, garden.avatar, avatar.avatarMaster를 fetch join으로 로딩.
Service: profile image resolution via garden slot
src/main/java/com/example/cp_main_be/domain/member/user/service/UserService.java
사용자 조회를 새 리포지토리 메서드로 교체. 프로필 이미지 결정: 최소 slotNumber 정원 → 해당 정원의 Avatar.imageUrl → 없으면 AvatarMaster.defaultImageUrl → 없으면 기존 user.profileImageUrl. Objects 활용한 null 필터링 추가. 다른 로직(팔로우/물주기)은 변경 없음.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant C as Client
    participant S as UserService
    participant R as UserRepository

    C->>S: getProfile(userId, profileUserId)
    S->>R: findByIdWithGardensAndAvatars(profileUserId)
    R-->>S: User{gardens{avatar{avatarMaster}}}

    rect rgba(235, 245, 255, 0.8)
    note right of S: 프로필 이미지 결정 로직 변경
    S->>S: 최소 slotNumber 정원 선택
    alt Avatar.imageUrl 존재
        S->>S: 이미지 = Avatar.imageUrl
    else AvatarMaster 기본 이미지
        S->>S: 이미지 = AvatarMaster.defaultImageUrl
    else 아바타 없음
        S->>S: 이미지 = user.profileImageUrl
    end
    end

    S-->>C: ProfileResponse(선택된 이미지 포함)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
유저 정보 조회 수정 (#154) 이슈에 구체적 요구사항이 없어 변경이 요구사항을 충족하는지 단정 불가.

Poem

작은 정원 사이로 귀 끄덕 토끼가 뿅!
가장 낮은 슬롯에서 빛나는 길을 찾아가요.
아바타가 웃으면 그 URL,
없으면 마스터의 별빛을 빌려요.
그래도 없다면, 내 사진으로 폴짝—완료! 🥕


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c5b2270 and 56ffaea.

📒 Files selected for processing (2)
  • src/main/java/com/example/cp_main_be/domain/member/user/domain/repository/UserRepository.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/user/service/UserService.java (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 154-유저-정보-조회-수정

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@xoruddl xoruddl merged commit 05f9802 into develop Aug 27, 2025
5 of 6 checks passed
@xoruddl xoruddl deleted the 154-유저-정보-조회-수정 branch August 28, 2025 07:11
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