Skip to content

dto 명세 수정#108

Merged
lejuho merged 1 commit into
developfrom
dto-modify
Aug 26, 2025
Merged

dto 명세 수정#108
lejuho merged 1 commit into
developfrom
dto-modify

Conversation

@lejuho
Copy link
Copy Markdown
Collaborator

@lejuho lejuho commented Aug 26, 2025

수정

Summary by CodeRabbit

  • New Features
    • 홈 화면: 다중 가든 요약 제공(가든 슬롯, 아바타 정보, 미션 ID 포함).
    • 미션 패널: 오늘 완료한 미션 수(todayMissionCount) 표시.
    • 사용자 프로필: 팔로우 상태, 남은 타인 물주기 횟수, 보유 가든 목록(슬롯/아바타/물주기 가능 여부) 제공.
  • Bug Fixes
    • 가든·프로필에서 아바타 이미지 URL 표시 정확도 개선.
  • Refactor
    • 가든/방명록 응답 DTO 구조 및 패키지 정리(기능 영향 없음).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

아바타/가든 DTO 매핑과 패키지 구조를 조정하고, 홈 화면 응답 구조를 다중 가든 요약 중심으로 개편했습니다. 사용자 프로필 조회 기능과 관련 DTO를 추가하고, 일일 미션 패널에 오늘 완료 미션 수를 포함했습니다. 게스트북 DTO 패키지를 response로 이동했으며, 일부 포맷 정리를 수행했습니다.

Changes

Cohort / File(s) Summary
Avatar DTO 매핑 조정
src/main/java/.../avatar/dto/response/AvatarMasterResponse.java, src/main/java/.../avatar/dto/response/AvatarSimpleResponse.java
AvatarMasterResponse.from에서 id를 master.getId()-2로 매핑 변경. AvatarSimpleResponse에 @Builder 추가, 생성자 제거 후 from(Avatar) 정적 팩토리 도입, 이미지 URL 소스 avatar.getImageUrl()로 변경.
Garden 응답 구조 개편
src/main/java/.../garden/garden/dto/response/GardenResponse.java, src/main/java/.../garden/garden/dto/response/GardenListResponse.java, src/main/java/.../garden/garden/presentation/GardenController.java, src/main/java/.../garden/garden/service/GardenService.java, src/test/java/.../garden/service/GardenServiceTest.java
GardenResponse 패키지를 .dto.response로 이동하고 AvatarSimpleResponse avatar 필드 추가 및 빌더 매핑 업데이트. GardenListResponse 신규 추가(리스트 컨테이너). 컨트롤러/서비스/테스트의 import 경로 업데이트.
Home 화면 DTO/서비스 리팩터링
src/main/java/.../home/HomeResponseDto.java, src/main/java/.../home/service/HomeService.java
HomeResponseDto에서 단일 GardenInfo 제거 후 List<GardenSummaryInfo> 도입, AvatarInfo 필드 재구성, MissionInfo에 missionId 추가, UserInfo에 id 추가 및 exp 타입 확장. HomeService는 요약 리스트 생성과 물주기/햇빛 가능 여부 계산으로 로직 변경, 날짜 계산 유틸 추가.
사용자 프로필 기능 추가
src/main/java/.../member/user/dto/response/UserProfileResponse.java, src/main/java/.../member/user/dto/response/UserGardenDetailResponse.java, src/main/java/.../member/user/presentation/UserController.java, src/main/java/.../member/user/service/UserService.java
UserProfileResponse, UserGardenDetailResponse DTO 신규. UserController의 getUserInfo 반환 타입을 프로필 DTO로 변경. UserService에 getUserProfile 추가(팔로우 상태, 타인 물주기 잔여 횟수, 가든/아바타/물주기 가능 여부 포함) 및 내부 날짜 유틸 추가.
미션 패널 지표 추가
src/main/java/.../mission/user_daily_mission/dto/MissionPanelResponse.java, src/main/java/.../mission/user_daily_mission/service/UserDailyMissionService.java
MissionPanelResponse에 todayMissionCount 필드 추가. Service에서 완료된 오늘의 미션 수 계산 후 빌더에 설정.
게스트북 DTO 패키지 정리
src/main/java/.../social/guestbook/dto/response/GuestbookResponse.java, src/main/java/.../social/guestbook/presentation/GuestbookController.java, src/main/java/.../social/guestbook/service/GuestbookService.java, src/test/java/.../social/guestbook/service/GuestbookServiceTest.java
GuestbookResponse 패키지를 .dto.response로 이동. 관련 컨트롤러/서비스/테스트의 import 경로 업데이트.
RealQuiz 포맷 정리
src/main/java/.../realquiz/RealQuiz.java, src/main/java/.../realquiz/dto/response/RealQuizAnswerResponseDTO.java, src/main/java/.../realquiz/presentation/RealQuizController.java
공백 라인 제거 등 비기능적 포맷 변경.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant Controller as UserController
  participant Service as UserService
  participant UserRepo as UserRepository
  participant FollowRepo as FollowRepository
  participant GardenRepo as GardenRepository
  participant LogRepo as FriendWateringLogRepository

  Client->>Controller: GET /users/{userId}
  Controller->>Service: getUserProfile(currentUserId, userId)
  Service->>UserRepo: findById(currentUserId)
  Service->>UserRepo: findById(userId)
  Service->>FollowRepo: check follow status
  Service->>GardenRepo: find gardens of profile user
  Service->>LogRepo: count today's watering by current user
  Service-->>Controller: UserProfileResponse (followStatus, leftWaterCount, userGardens[])
  Controller-->>Client: ApiResponse<UserProfileResponse>
Loading
sequenceDiagram
  autonumber
  actor Client
  participant Controller as HomeController
  participant Service as HomeService
  participant GardenRepo as GardenRepository
  participant MissionRepo as MissionRepository
  note over Service: 리팩터링된 홈 요약 응답 흐름
  Client->>Controller: GET /home
  Controller->>Service: getHomeScreenData(userId)
  Service->>GardenRepo: 사용자 가든 목록 조회
  Service->>Service: 시작 시각 계산(getStartOfCurrentWateringDay/SunlightDay)
  Service->>MissionRepo: 오늘 미션 조회
  Service-->>Controller: HomeResponseDto(UserInfo, GardenSummaries[], Missions)
  Controller-->>Client: ApiResponse<HomeResponseDto>
Loading
sequenceDiagram
  autonumber
  actor Client
  participant Controller as MissionController
  participant Service as UserDailyMissionService
  participant Repo as UserDailyMissionRepository
  Client->>Controller: GET /missions/panel
  Controller->>Service: getMissionPanel(userId)
  Service->>Repo: find today's missions
  Service->>Service: 완료 여부 카운트(todayMissionCount)
  Service-->>Controller: MissionPanelResponse(todayMissionCount, dailyMissions, wishTree)
  Controller-->>Client: ApiResponse<MissionPanelResponse>
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • c5ln

Poem

새싹 흔들~ 토끼는 깡총깡총 뛰며 말해요 🥕
가든은 줄 맞춰 요약되고, 아바타는 더 또렷해졌죠.
프로필엔 팔로우 빛, 미션엔 오늘의 숫자!
게스트북 주소도 제자리로.
코드밭에 물 한 번, 햇살 한 줌 — 빛나요, PR! ✨


📜 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 d19b738 and 65194fb.

📒 Files selected for processing (22)
  • src/main/java/com/example/cp_main_be/domain/avatar/avatar/dto/response/AvatarMasterResponse.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/avatar/avatar/dto/response/AvatarSimpleResponse.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/garden/garden/dto/response/GardenListResponse.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/garden/garden/dto/response/GardenResponse.java (4 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 (1 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 (3 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/user/dto/response/UserGardenDetailResponse.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/user/dto/response/UserProfileResponse.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/user/presentation/UserController.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/user/service/UserService.java (3 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/user_daily_mission/dto/MissionPanelResponse.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/user_daily_mission/service/UserDailyMissionService.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/RealQuiz.java (0 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/dto/response/RealQuizAnswerResponseDTO.java (0 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/presentation/RealQuizController.java (0 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/guestbook/dto/response/GuestbookResponse.java (1 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 (1 hunks)
  • src/test/java/com/example/cp_main_be/domain/garden/service/GardenServiceTest.java (1 hunks)
  • src/test/java/com/example/cp_main_be/domain/social/guestbook/service/GuestbookServiceTest.java (2 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 dto-modify

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.

@lejuho lejuho merged commit 58d5346 into develop Aug 26, 2025
5 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