Skip to content

[WTH-454] 마이페이지 수정사항 반영 - #94

Merged
soo0711 merged 4 commits into
devfrom
fix/WTH-454-마이페이지-수정사항-반영
Jul 22, 2026

Hidden character warning

The head ref may contain hidden characters: "fix/WTH-454-\ub9c8\uc774\ud398\uc774\uc9c0-\uc218\uc815\uc0ac\ud56d-\ubc18\uc601"
Merged

[WTH-454] 마이페이지 수정사항 반영#94
soo0711 merged 4 commits into
devfrom
fix/WTH-454-마이페이지-수정사항-반영

Conversation

@soo0711

@soo0711 soo0711 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

📌 Summary

어떤 작업인지 한 줄 요약해 주세요.

마이페이지 수정사항 반영

📝 Changes

변경사항을 what, why, how로 구분해 작성해 주세요.

What

프로필 사용할 동아리 목록 조회
동아리별로 내가 쓴 글, 내가 출석한 세션 개수 맞는지 확인
마이페이지 요약 조회

Why

마이페이지 수정사항이 생김

How

프로필 사용할 동아리 목록 api 추가
마이페이지 요약을 clubId path를 추가해서 동아리별 쓴 글, 세션 개수와 현재 사용중인 멀티프로필 응답 추가

📸 Screenshots / Logs

필요시 스크린샷 or 로그를 첨부해주세요.
현재 동아리 마이페이지 요약 조회

스크린샷 2026-07-22 오전 12 38 22 -> 동아리별 쓴 글, 세션 개수로 수정, 현재 진입한 동아리에서 사용중인 멀티프로필 응답 추가

프로필 사용할 수 있는 동아리 목록
스크린샷 2026-07-22 오전 12 38 36

💡 Reviewer 참고사항

리뷰에 참고할 내용을 작성해주세요.
지원님 생각해보니까 현재 진입한 동아리에서 사용 중인 멀티프로필 정보는 없더라고요! 그래서 마이페이지 요약 응답에 추가해뒀습니다!
마이페이지 진입시에 사용하면 됩니다!

✅ Checklist

  • PR 제목 설정 완료 (WTH-123 인증 필터 설정)
  • 테스트 구현 완료
  • 리뷰어 등록 완료
  • 자체 코드 리뷰 완료

Summary by CodeRabbit

  • 새로운 기능

    • 사용자가 프로필에 사용할 수 있는 활동 중인 동아리 목록을 조회할 수 있습니다.
    • 동아리별 이름, 이미지, 활성 회원 수가 함께 제공됩니다.
    • 동아리별 마이페이지 요약에서 현재 사용 중인 프로필 정보가 표시됩니다.
    • 마이페이지 요약 조회 시 선택한 동아리 기준의 회원 활동 정보가 제공됩니다.
  • 변경 사항

    • 프로필 할당 가능 동아리 조회 경로가 새로 제공됩니다.
    • 기존 사용자 마이페이지 요약 조회 경로는 동아리 회원 영역으로 이동되었습니다.
  • 테스트

    • 동아리 목록, 프로필 정보, 마이페이지 요약 조회에 대한 검증을 추가했습니다.

@soo0711
soo0711 requested review from hyxklee and woneeeee July 21, 2026 15:45
@soo0711 soo0711 self-assigned this Jul 21, 2026
@soo0711 soo0711 added the 🐞 BugFix 버그 수정 label Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

클럽별 활성 멤버 수 집계와 프로필 할당 가능 클럽 조회 API가 추가되었다. 마이페이지는 clubId 기준으로 활성 멤버와 현재 프로필을 조회하며, 요약 엔드포인트가 클럽 멤버 컨트롤러로 이동했다.

Changes

프로필 할당 가능 클럽 조회

Layer / File(s) Summary
클럽별 멤버 집계 및 응답 구성
src/main/kotlin/com/weeth/domain/club/domain/repository/*, src/main/kotlin/com/weeth/domain/user/application/dto/response/UserProfileAssignableClubsResponse.kt, src/main/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryService.kt, src/test/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryServiceTest.kt
활성 멤버 수를 클럽별로 집계하고, 활성 클럽·인코딩된 ID·이미지 URL·멤버 수를 응답으로 매핑한다.

현재 프로필 마이페이지 반영

Layer / File(s) Summary
클럽 기준 마이페이지와 현재 프로필 매핑
src/main/kotlin/com/weeth/domain/user/application/dto/response/UserMyPageResponse.kt, src/main/kotlin/com/weeth/domain/user/application/mapper/UserMyPageMapper.kt, src/main/kotlin/com/weeth/domain/user/application/usecase/query/GetUserMyPageQueryService.kt, src/test/kotlin/com/weeth/domain/user/application/usecase/query/GetUserMyPageQueryServiceTest.kt
getMyPageclubId와 활성 멤버를 사용하고, 현재 프로필 정보와 해당 멤버 기준 통계를 응답하며 이를 테스트한다.

API 엔드포인트 연결

Layer / File(s) Summary
마이페이지 및 프로필 클럽 API wiring
src/main/kotlin/com/weeth/domain/user/presentation/*, src/test/kotlin/com/weeth/domain/user/presentation/*
GET /me/profiles/assignable-clubs를 추가하고 GET /me/mypage를 클럽 멤버 요약 엔드포인트로 대체했으며, 응답 코드와 컨트롤러 테스트를 갱신한다.

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: 성공 응답
Loading

Possibly related PRs

Suggested labels: ✨ Feature, 📬 API

Suggested reviewers: hyxklee

Poem

깡충 토끼가 클럽을 세고
프로필 당근을 골라 담네
현재 멤버 길을 따라
마이페이지 꽃이 피어요
API도 폴짝, 테스트도 폴짝 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed PR 제목이 핵심 변경사항인 마이페이지 수정 반영을 간결하게 잘 요약합니다.
Description check ✅ Passed 요약, 변경사항의 What/Why/How, 스크린샷, 참고사항, 체크리스트가 모두 있어 템플릿을 대부분 충족합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/WTH-454-마이페이지-수정사항-반영

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 68298a4 and 8716f84.

📒 Files selected for processing (15)
  • src/main/kotlin/com/weeth/domain/club/domain/repository/ClubMemberCount.kt
  • src/main/kotlin/com/weeth/domain/club/domain/repository/ClubMemberReader.kt
  • src/main/kotlin/com/weeth/domain/club/domain/repository/ClubMemberRepository.kt
  • src/main/kotlin/com/weeth/domain/user/application/dto/response/UserMyPageResponse.kt
  • src/main/kotlin/com/weeth/domain/user/application/dto/response/UserProfileAssignableClubsResponse.kt
  • src/main/kotlin/com/weeth/domain/user/application/mapper/UserMyPageMapper.kt
  • src/main/kotlin/com/weeth/domain/user/application/usecase/query/GetUserMyPageQueryService.kt
  • src/main/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryService.kt
  • src/main/kotlin/com/weeth/domain/user/presentation/ClubMemberMyPageController.kt
  • src/main/kotlin/com/weeth/domain/user/presentation/UserController.kt
  • src/main/kotlin/com/weeth/domain/user/presentation/UserResponseCode.kt
  • src/test/kotlin/com/weeth/domain/user/application/usecase/query/GetUserMyPageQueryServiceTest.kt
  • src/test/kotlin/com/weeth/domain/user/application/usecase/query/GetUserProfileAssignableClubQueryServiceTest.kt
  • src/test/kotlin/com/weeth/domain/user/presentation/ClubMemberMyPageControllerTest.kt
  • src/test/kotlin/com/weeth/domain/user/presentation/UserControllerTest.kt

@hyxklee hyxklee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

머지하구 프론트 작업에 따른 후속 수정사항 대응하면 댈 것 같아요!
고생하셨습니다아아

@soo0711
soo0711 merged commit eab363c into dev Jul 22, 2026
2 checks passed
@soo0711
soo0711 deleted the fix/WTH-454-마이페이지-수정사항-반영 branch July 22, 2026 04:10
soo0711 added a commit that referenced this pull request Jul 27, 2026
* [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 방지
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 BugFix 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants