Skip to content

Chore/ggg#158

Merged
lejuho merged 2 commits into
developfrom
chore/ggg
Aug 27, 2025
Merged

Chore/ggg#158
lejuho merged 2 commits into
developfrom
chore/ggg

Conversation

@lejuho
Copy link
Copy Markdown
Collaborator

@lejuho lejuho commented Aug 27, 2025

Summary by CodeRabbit

  • 신기능

    • 홈 화면에 각 정원 슬롯의 잠금해제 가능 여부 표시.
    • 다음 정원 잠금 해제 API 추가.
    • 회원가입 시 정원 슬롯 4개 자동 생성(1번 즉시 사용 가능).
    • 아바타 생성 시 첫 번째 빈 정원에 자동 배치.
  • 개선

    • 이미지 생성/처리 대기시간 확대로 안정성 향상.
    • 팔로워/팔로잉 목록에서 닉네임과 아바타 이미지 노출.
  • 버그 수정

    • 자기 자신 팔로우 시도 방지.
  • API 변경

    • 방명록 목록 조회에 사용자 ID를 포함해 타 사용자 방명록 조회 지원.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

아바타 배치 로직을 정원 중심으로 개편하고, 위시트리 성장을 2단계(잠금해제 가능 상태 → 단계 진화)로 분리했다. 정원은 슬롯 선생성 후 잠금해제만 수행하도록 변경되었고, 홈 화면 DTO/서비스는 잠금해제 가능 여부를 노출한다. 팔로우/방명록/회원가입/이미지 처리 등 관련 경로도 업데이트됐다.

Changes

Cohort / File(s) Change summary
Avatar 배치 리팩터링
src/.../avatar/avatar/service/AvatarService.java
위시트리 기반 정원 생성/검증 제거. 사용자에게서 잠금해제된 빈 정원 검색 후 updateAvatar(newAvatar)로 배치. 가용 정원 없으면 GARDEN_NOT_FOUND 예외.
정원 도메인/리포지토리/서비스/컨트롤러(슬롯 잠금해제 플로우)
src/.../garden/garden/domain/Garden.java, .../repository/GardenRepository.java, .../service/GardenService.java, .../presentation/GardenController.java
Garden에 unlock() 추가. Repository에 잠금/빈 슬롯 조회 메서드 3개 추가. unlockNewGardenSlot 제거, unlockNextGarden 도입: WishTree의 isUnlockable 검사→evolveStage()→가장 낮은 번호의 잠금 슬롯 해제. 컨트롤러에 POST /unlock 추가 및 기존 호출 대상 변경.
WishTree 성장 모델 개편
src/.../mission/wishTree/WishTree.java, .../WishTreeService.java
isUnlockable 필드 추가. addPoints(Long)이 성장 즉시 진화 대신 잠금해제 가능 상태만 설정하도록 변경(리턴값 제거). evolveStage() 신설로 실제 단계 상승. Service는 이벤트 발행 제거.
홈 화면 DTO/서비스
src/.../home/HomeResponseDto.java, .../home/service/HomeService.java
GardenSummaryInfo에 isUnlockable 필드 추가 및 빌더 반영. 홈 서비스가 WishTree 기반으로 레벨/경험치 계산. 잠금 정원에 대해 다음 슬롯이면서 WishTree가 unlockable인 경우 isUnlockable=true 설정.
회원가입 시 기본 정원 생성
src/.../member/auth/service/AuthService.java
회원 등록 트랜잭션 내에 슬롯 1–4 정원 선생성(1번만 잠금해제).
User–WishTree 연관
src/.../member/user/domain/User.java
User에 WishTree 양방향 일대일 매핑 필드 추가.
이미지 처리 타임아웃
src/.../avatar/image/service/ImageProcessingService.java
WebClient 요청 및 블로킹 타임아웃 30s→300s.
팔로우 서비스 검증/매핑 변경
src/.../social/follow/service/FollowService.java, src/.../global/common/ErrorCode.java
자기 자신 팔로우 금지 검증 추가(SELF_FOLLOWING_UNABLE). 팔로워/팔로잉 리스트에서 닉네임과 아바타 기반 이미지 URL 사용.
방명록 API 파라미터화
src/.../social/guestbook/presentation/GuestbookController.java, .../guestbook/service/GuestbookService.java
엔드포인트를 /guestbook/{userId}/list로 변경. 서비스 시그니처에 userId 추가, 대상 사용자 조회 및 미존재 시 NOT_FOUND 처리.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant AS as AvatarService
  participant GR as GardenRepository
  participant G as Garden
  participant AMR as AvatarMasterRepo

  U->>AS: createAvatar(request)
  AS->>AMR: find master (by id or AI default)
  AS->>GR: findFirstByUserAndIsLockedIsFalseAndAvatarIsNullOrderBySlotNumberAsc(user)
  alt 빈 잠금해제 정원 존재
    GR-->>AS: Optional<Garden>(emptyGarden)
    AS->>G: emptyGarden.updateAvatar(newAvatar)
    AS-->>U: Avatar created and placed
  else 없음
    AS-->>U: throw GARDEN_NOT_FOUND
  end
Loading
sequenceDiagram
  autonumber
  actor U as User
  participant GC as GardenController
  participant GS as GardenService
  participant WR as WishTreeRepo
  participant GR as GardenRepository
  participant G as Garden
  note over GS: New flow: unlockNextGarden

  U->>GC: POST /api/v1/gardens/unlock
  GC->>GS: unlockNextGarden(userId)
  GS->>WR: find WishTree by userId
  alt WishTree.isUnlockable == true
    GS->>WR: wishTree.evolveStage()
    GS->>GR: findFirstByUserAndIsLockedIsTrueOrderBySlotNumberAsc(user)
    alt Locked garden exists
      GR-->>GS: Garden
      GS->>G: unlock()
      GS-->>GC: 200 OK
    else None
      GS-->>GC: throw GARDEN_NOT_FOUND
    end
  else Not unlockable
    GS-->>GC: throw GARDEN_SLOT_LOCKED
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Possibly related PRs

Suggested reviewers

  • xoruddl
  • c5ln

Poem

새싹 꿈나무 톡, 점수로 빗물 콕,
오늘은 잠금 풀고 내일은 꽃을 쏙.
첫 정원은 활짝, 셋 넷은 살짝 잠금—똑!
토끼는 귀를 쫑긋, 슬롯 번호를 쏙쏙.
아바타야 자리 잡아, 봄바람 타고 락 해제! 🐇🌱


📜 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 613e72c and c19c076.

📒 Files selected for processing (16)
  • src/main/java/com/example/cp_main_be/domain/avatar/avatar/service/AvatarService.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/avatar/image/service/ImageProcessingService.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/garden/garden/domain/Garden.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/garden/garden/domain/repository/GardenRepository.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/garden/garden/presentation/GardenController.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/garden/garden/service/GardenService.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/home/HomeResponseDto.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/home/service/HomeService.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/auth/service/AuthService.java (4 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/user/domain/User.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/wishTree/WishTree.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/wishTree/WishTreeService.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/follow/service/FollowService.java (4 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/guestbook/presentation/GuestbookController.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/guestbook/service/GuestbookService.java (2 hunks)
  • src/main/java/com/example/cp_main_be/global/common/ErrorCode.java (1 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 chore/ggg

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.

@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR 본문이 비어있습니다!

아래 템플릿을 복사하여 PR 내용을 작성해주세요.


📝 개요

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


💻 작업 내용

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

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

✅ PR 체크리스트

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

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

🔗 관련 이슈

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


스크린샷 (선택)

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

@lejuho lejuho merged commit 716d705 into develop Aug 27, 2025
4 of 6 checks passed
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