[WTH-454] 마이페이지 수정사항 반영 - #94
Hidden character warning
Conversation
📝 WalkthroughWalkthrough클럽별 활성 멤버 수 집계와 프로필 할당 가능 클럽 조회 API가 추가되었다. 마이페이지는 Changes프로필 할당 가능 클럽 조회
현재 프로필 마이페이지 반영
API 엔드포인트 연결
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant UserController
participant GetUserProfileAssignableClubQueryService
participant ClubMemberReader
participant FileAccessUrlPort
Client->>UserController: GET /me/profiles/assignable-clubs
UserController->>GetUserProfileAssignableClubQueryService: findAll(userId)
GetUserProfileAssignableClubQueryService->>ClubMemberReader: 활성 클럽 및 멤버 수 조회
ClubMemberReader-->>GetUserProfileAssignableClubQueryService: 클럽별 멤버 수
GetUserProfileAssignableClubQueryService->>FileAccessUrlPort: 이미지 URL 해석
FileAccessUrlPort-->>GetUserProfileAssignableClubQueryService: 이미지 URL
GetUserProfileAssignableClubQueryService-->>UserController: UserProfileAssignableClubsResponse
UserController-->>Client: 성공 응답
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/test/kotlin/com/weeth/domain/user/presentation/UserControllerTest.kt (1)
218-219: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win새로운 엔드포인트에 대한 테스트 누락을 보완해 주세요.
UserController에 새로 추가된getUserProfileAssignableClubs엔드포인트에 대한 테스트 블록이 누락되어 있습니다. 컨트롤러 로직 검증과 테스트 커버리지를 위해 해당 테스트를 추가하는 것을 권장합니다.테스트 추가 제안
} } + + describe("getUserProfileAssignableClubs") { + it("프로필을 사용할 수 있는 동아리 목록을 조회한다") { + val responseDto = UserProfileAssignableClubsResponse(emptyList()) + io.mockk.every { getUserProfileAssignableClubQueryService.findAll(1L) } returns responseDto + + val response = controller.getUserProfileAssignableClubs(1L) + + response.code shouldBe UserResponseCode.USER_PROFILE_ASSIGNABLE_CLUBS_FIND_SUCCESS.code + response.message shouldBe UserResponseCode.USER_PROFILE_ASSIGNABLE_CLUBS_FIND_SUCCESS.message + response.data shouldBe responseDto + } + } })🤖 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/test/kotlin/com/weeth/domain/user/presentation/UserControllerTest.kt` around lines 218 - 219, 새 엔드포인트 getUserProfileAssignableClubs에 대한 테스트 블록을 UserControllerTest에 추가하세요. UserController의 해당 메서드가 정상 응답과 필요한 요청 조건을 올바르게 처리하는지 기존 테스트 패턴과 픽스처를 재사용해 검증하고, 엔드포인트 동작을 커버하도록 구성하세요.
🧹 Nitpick comments (1)
src/main/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryService.kt (1)
20-24: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value중복 클럽 응답 방지를 위한 방어적 로직 추가를 고려해 주세요.
사용자가 동일한 클럽에서 여러 개의 활성 멤버십(예: 다른 역할)을 가질 수 있는 엣지 케이스가 존재할 경우, 응답에 동일한 클럽이 중복해서 포함될 수 있습니다. 이를 방어하기 위해
distinctBy { it.id }를 추가하는 것을 권장합니다.💡 제안하는 리팩토링
val clubs = clubMemberReader .findAllByUserIdAndMemberStatusWithClub(userId, MemberStatus.ACTIVE) .map { it.club } + .distinctBy { it.id } .sortedBy { it.id }🤖 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/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryService.kt` around lines 20 - 24, Update the club collection transformation in GetUserProfileAssignableClubQueryService to apply distinctBy using each club’s id after mapping memberships to clubs, before sorting or returning the results. Preserve the existing active-membership filtering and ascending id ordering while ensuring each club appears only once.
🤖 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.
Outside diff comments:
In `@src/test/kotlin/com/weeth/domain/user/presentation/UserControllerTest.kt`:
- Around line 218-219: 새 엔드포인트 getUserProfileAssignableClubs에 대한 테스트 블록을
UserControllerTest에 추가하세요. UserController의 해당 메서드가 정상 응답과 필요한 요청 조건을 올바르게 처리하는지
기존 테스트 패턴과 픽스처를 재사용해 검증하고, 엔드포인트 동작을 커버하도록 구성하세요.
---
Nitpick comments:
In
`@src/main/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryService.kt`:
- Around line 20-24: Update the club collection transformation in
GetUserProfileAssignableClubQueryService to apply distinctBy using each club’s
id after mapping memberships to clubs, before sorting or returning the results.
Preserve the existing active-membership filtering and ascending id ordering
while ensuring each club appears only once.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1eeb4a06-90e5-4e4b-9d1f-46eb76acbc14
📒 Files selected for processing (15)
src/main/kotlin/com/weeth/domain/club/domain/repository/ClubMemberCount.ktsrc/main/kotlin/com/weeth/domain/club/domain/repository/ClubMemberReader.ktsrc/main/kotlin/com/weeth/domain/club/domain/repository/ClubMemberRepository.ktsrc/main/kotlin/com/weeth/domain/user/application/dto/response/UserMyPageResponse.ktsrc/main/kotlin/com/weeth/domain/user/application/dto/response/UserProfileAssignableClubsResponse.ktsrc/main/kotlin/com/weeth/domain/user/application/mapper/UserMyPageMapper.ktsrc/main/kotlin/com/weeth/domain/user/application/usecase/query/GetUserMyPageQueryService.ktsrc/main/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryService.ktsrc/main/kotlin/com/weeth/domain/user/presentation/ClubMemberMyPageController.ktsrc/main/kotlin/com/weeth/domain/user/presentation/UserController.ktsrc/main/kotlin/com/weeth/domain/user/presentation/UserResponseCode.ktsrc/test/kotlin/com/weeth/domain/user/application/usecase/query/GetUserMyPageQueryServiceTest.ktsrc/test/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryServiceTest.ktsrc/test/kotlin/com/weeth/domain/user/presentation/ClubMemberMyPageControllerTest.ktsrc/test/kotlin/com/weeth/domain/user/presentation/UserControllerTest.kt
hyxklee
left a comment
There was a problem hiding this comment.
머지하구 프론트 작업에 따른 후속 수정사항 대응하면 댈 것 같아요!
고생하셨습니다아아
* [WTH-433] 마이페이지 UI 변경에 맞춰 멀티프로필 api 구현 (#90) * feat: 유저 프로필 엔티티 추가 * feat: 유저 프로필 레포 추가 * feat: 멀티프로필 DTO * feat: 유저 프로필 Mapper * feat: 유저 프로필 파일 타입 추가 * feat: 멀티프로필 생성, 조회 API 추가 * feat: 멀티프로필 생성, 조회 API 추가 * feat: 멀티프로필 수정 API 추가 * feat: 동아리별 멀티프로필 로직 추가 * feat: 동아리별 멀티프로필 API 추가 * feat: 멀티프로필 삭제 및 동시성 제어 추가 * feat: 내 동아리 목록에 사용 프로필 추가 * feat: 게시글 작성자 프로필을 멀티프로필에 맞춰 변경 * feat: 댓글 작성자 프로필을 멀티프로필에 맞춰 변경 * refactor: 작성자 프로필 매핑 중복 제거 * feat: 대시보드 게시글 작성자 정보 멀티프로필로 변경 * feat: 마이페이지 요약 조회 API 추가 * feat: 마이페이지 요약 조회 API 추가 * feat: 내가 쓴 글 조회 API 추가 * feat: 출석한 세션 조회 API 추가 * docs: 기존 동아리 프로필 API deprecated 표시 * refactor: 마이그레이션 쿼리 추가 * refactor: 기존 기능 삭제 * refactor: 리뷰 반영 * refactor: 리뷰 반영 * refactor: 리뷰 반영 * refactor: 무한스크롤로 변경 * refactor: 마이페이지 동아리 목록 기본값 제거 * refactor: 마이페이지 이미지 삭제 API 분리 * refactor: 멀티프로필 마이그레이션 버전 수정 * [WTH-450] v11 마이그레이션 수정 (#92) * fix: v11 마이그레이션 수정 * refactor: 게시글 조회 생성시간 응답 * refactor: 멀티프로필 생성시 동아리 필수 선택 * [WTH-451] 마이페이지 api 수정 (#93) * refactor: 멀티프로필 응답 usingClubs 수정 * refactor: 마이페이지 게시글 isNew 응답 추가 * refactor: 마이페이지 활동을 동아리 기준으로 조회 * refactor: 홈 대시보드 사용자 정보 멀티프로필로 수정 * refactor: 게시글 조회 시간 Clock 주입으로 변경 * [WTH-454] 마이페이지 수정사항 반영 (#94) * refactor: 마이페이지 요약에 현재 사용 중인 멀티프로필 추가 * refactor: 마이페이지 통계 현재 동아리 기준으로 수정 * feat: 프로필 사용 가능 동아리 목록 조회 추가 * refactor: 멤버 카운트 n+1 방지
📌 Summary
마이페이지 수정사항 반영
📝 Changes
What
프로필 사용할 동아리 목록 조회
동아리별로 내가 쓴 글, 내가 출석한 세션 개수 맞는지 확인
마이페이지 요약 조회
Why
마이페이지 수정사항이 생김
How
프로필 사용할 동아리 목록 api 추가
마이페이지 요약을 clubId path를 추가해서 동아리별 쓴 글, 세션 개수와 현재 사용중인 멀티프로필 응답 추가
📸 Screenshots / Logs
프로필 사용할 수 있는 동아리 목록

💡 Reviewer 참고사항
✅ Checklist
Summary by CodeRabbit
새로운 기능
변경 사항
테스트