Feat: [FN-325] 내가 신청한 가입 신청 리스트 조회 API 추가#14
Conversation
Walkthrough사용자가 신청한 그룹 가입 요청 목록을 조회하는 새로운 기능이 추가되었습니다. MeController 엔드포인트를 통해 X-USER-ID 헤더로 사용자를 식별하고, 계층화된 아키텍처(서비스, 리포지토리)를 따라 데이터를 조회하여 응답합니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant MeController
participant FindMyJoinListService
participant JoinRepositoryPort
participant JoinRepositoryAdapter
participant JoinRepository
participant Database
Client->>MeController: GET /v1/joins/me (X-USER-ID: userId)
activate MeController
MeController->>FindMyJoinListService: findMyJoinList(userId)
activate FindMyJoinListService
FindMyJoinListService->>JoinRepositoryPort: findMyJoinList(userId)
activate JoinRepositoryPort
JoinRepositoryPort->>JoinRepositoryAdapter: findMyJoinList(userId)
activate JoinRepositoryAdapter
JoinRepositoryAdapter->>JoinRepository: findAllByUserId(userId)
activate JoinRepository
JoinRepository->>Database: Query JoinEntity by userId
activate Database
Database-->>JoinRepository: List<JoinEntity>
deactivate Database
JoinRepository-->>JoinRepositoryAdapter: List<JoinEntity>
deactivate JoinRepository
JoinRepositoryAdapter-->>JoinRepositoryPort: List<JoinEntity>
deactivate JoinRepositoryAdapter
deactivate JoinRepositoryPort
FindMyJoinListService->>FindMyJoinListService: FindMyJoinListResult.of(joinList)
FindMyJoinListService-->>MeController: FindMyJoinListResult
deactivate FindMyJoinListService
MeController->>MeController: FindMyJoinListResponseDto.from(result)
MeController-->>Client: 200 OK + FindMyJoinListResponseDto
deactivate MeController
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/java/flipnote/group/application/port/in/result/FindMyJoinListResult.java (1)
5-15: 애플리케이션 레이어가 어댑터 엔티티에 직접 의존하고 있습니다.
FindMyJoinListResult.of(List<JoinEntity>)시그니처로 인해 영속성 모델 변경이 유즈케이스 결과 모델까지 전파됩니다. 포트 경계에서는 도메인 모델 또는 전용 조회 모델을 사용하도록 분리하는 쪽이 유지보수에 유리합니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/flipnote/group/application/port/in/result/FindMyJoinListResult.java` around lines 5 - 15, FindMyJoinListResult currently depends on persistence entity JoinEntity via the static factory FindMyJoinListResult.of(List<JoinEntity>), which leaks adapter concerns into the application port; change the factory to accept domain/DTO types instead (e.g., change signature to FindMyJoinListResult.of(List<JoinInfo>) and remove import/use of JoinEntity inside FindMyJoinListResult) and simplify to directly wrap the provided List<JoinInfo>. Update all callers (e.g., adapters/repositories) to perform JoinEntity -> JoinInfo mapping before calling FindMyJoinListResult.of so the application layer only depends on JoinInfo (domain model) and not JoinEntity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/java/flipnote/group/adapter/in/web/MeController.java`:
- Around line 27-30: 현재 MeController.findGroupJoinMe가 X-USER-ID 헤더를 신뢰해 IDOR 위험이
있으니 요청자의 식별은 인증 컨텍스트에서 가져오도록 변경하세요: MeController.findGroupJoinMe에서
`@RequestHeader`("X-USER-ID") Long userId 대신 Spring Security의
Authentication/Principal 또는 SecurityContextHolder에서 사용자 ID를 추출하고, 만약 헤더를 유지해야
한다면 추출한 인증 ID와 헤더 값을 비교해 불일치 시 403을 반환하도록 검증을 추가하세요; 또한 FindMyJoinListUseCase 호출
전/후의 checkPermission/checkRole 검사들이 "실제 인증된 사용자"를 기반으로 동작하도록 보장하세요 (필요하면 인증
미들웨어/필터가 존재하는지 확인하고 없으면 도입을 요구).
In
`@src/main/java/flipnote/group/infrastructure/persistence/jpa/JoinRepository.java`:
- Line 15: The current repository method findAllByUserId in JoinRepository
returns an unbounded list which can cause latency/memory issues and
nondeterministic ordering; change the contract to support pagination and
explicit ordering (e.g., replace List<JoinEntity> findAllByUserId(Long userId)
with a pageable/sort-capable signature such as using Spring Data's
Page<JoinEntity> findByUserId(Long userId, Pageable pageable) or at minimum
List<JoinEntity> findByUserId(Long userId, Sort sort) and update all callers to
supply a Pageable/Sort to enforce limits and deterministic ordering.
---
Nitpick comments:
In
`@src/main/java/flipnote/group/application/port/in/result/FindMyJoinListResult.java`:
- Around line 5-15: FindMyJoinListResult currently depends on persistence entity
JoinEntity via the static factory FindMyJoinListResult.of(List<JoinEntity>),
which leaks adapter concerns into the application port; change the factory to
accept domain/DTO types instead (e.g., change signature to
FindMyJoinListResult.of(List<JoinInfo>) and remove import/use of JoinEntity
inside FindMyJoinListResult) and simplify to directly wrap the provided
List<JoinInfo>. Update all callers (e.g., adapters/repositories) to perform
JoinEntity -> JoinInfo mapping before calling FindMyJoinListResult.of so the
application layer only depends on JoinInfo (domain model) and not JoinEntity.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
src/main/java/flipnote/group/adapter/in/web/JoinController.javasrc/main/java/flipnote/group/adapter/in/web/MeController.javasrc/main/java/flipnote/group/adapter/out/persistence/JoinRepositoryAdapter.javasrc/main/java/flipnote/group/api/dto/response/FindMyJoinListResponseDto.javasrc/main/java/flipnote/group/application/port/in/FindMyJoinListUseCase.javasrc/main/java/flipnote/group/application/port/in/result/FindMyJoinListResult.javasrc/main/java/flipnote/group/application/port/out/JoinRepositoryPort.javasrc/main/java/flipnote/group/application/service/FindMyJoinListService.javasrc/main/java/flipnote/group/infrastructure/persistence/jpa/JoinRepository.java
💤 Files with no reviewable changes (1)
- src/main/java/flipnote/group/adapter/in/web/JoinController.java
Summary by CodeRabbit
New Features
Chores