-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: [FN-120] 나의 그룹 전체 조회 #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough인증 사용자 전용 그룹 조회 기능을 추가했다. 컨트롤러에 GET /v1/groups/me 엔드포인트를 신설하고, 서비스와 리포지토리에 사용자 ID 기반 커서 페이지네이션 조회 로직을 추가했으며, 공용 페이지 응답 생성 로직을 헬퍼 메서드로 추출했다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant API as GroupController (/v1/groups/me)
participant SVC as GroupService
participant REPO as GroupRepositoryImpl
participant DB as DB
User->>API: GET /v1/groups/me?lastId=&category=&pageSize=
API->>SVC: findMyGroup(auth, req)
SVC->>REPO: findAllByCursorAndUserId(lastId, category, pageSize+1, auth.userId)
REPO->>DB: SELECT groups JOIN group_members WHERE user_id = ?
DB-->>REPO: List<GroupInfo> (size ≤ pageSize+1)
REPO-->>SVC: groups
rect rgba(200,220,255,0.2)
note right of SVC: 커서 페이지 응답 생성\n- hasNext 계산\n- 목록 trim\n- nextCursor 설정
end
SVC-->>API: CursorPagingResponse<GroupInfo>
API-->>User: 200 OK (JSON)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/main/java/project/flipnote/group/repository/GroupRepositoryCustom.java (1)
11-11: 메서드 추가 자체는 합리적이지만, 계약(Contract) 명시 보강 제안
- lastId의 배타/포함(lt vs lte), 정렬 기준(id desc), pageSize 하한(>=1), userId의 null 불가 여부를 자바독/어노테이션으로 명시해 주세요. 팀 내 일관된 계약 없으면 오용 가능성이 큽니다.
- 파라미터 순서도 고려해 보세요: 필터(userId, category) → 커서(lastId) → 페이징(pageSize). 기존 메서드와의 일관성만 유지되면 OK입니다.
src/main/java/project/flipnote/group/controller/GroupController.java (1)
97-107: GET /v1/groups/me 추가 LGTM. 컨벤션/보안 흐름 자연스럽습니다.
- 경로 충돌 없이 기존 엔드포인트와 공존합니다. 반환 모델도 재사용 적절.
- 소소 제안: 메서드명을 findMyGroups(복수)로, 스웨거 사용 시 @operation(summary=...) 추가 검토.
📜 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.
📒 Files selected for processing (4)
src/main/java/project/flipnote/group/controller/GroupController.java(1 hunks)src/main/java/project/flipnote/group/repository/GroupRepositoryCustom.java(1 hunks)src/main/java/project/flipnote/group/repository/GroupRepositoryImpl.java(3 hunks)src/main/java/project/flipnote/group/service/GroupService.java(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
src/main/java/project/flipnote/group/controller/GroupController.java (2)
src/main/java/project/flipnote/groupjoin/service/GroupJoinService.java (1)
findGroupJoinListMe(277-285)src/main/java/project/flipnote/groupjoin/controller/GroupJoinController.java (2)
RestController(14-76)GetMapping(68-75)
src/main/java/project/flipnote/group/repository/GroupRepositoryCustom.java (2)
src/main/java/project/flipnote/group/repository/GroupMemberRepositoryCustom.java (2)
GroupMemberRepositoryCustom(7-9)findGroupMembers(8-8)src/main/java/project/flipnote/group/repository/GroupRepository.java (1)
Repository(14-27)
src/main/java/project/flipnote/group/service/GroupService.java (1)
src/main/java/project/flipnote/groupjoin/service/GroupJoinService.java (1)
findGroupJoinListMe(277-285)
src/main/java/project/flipnote/group/repository/GroupRepositoryImpl.java (1)
src/main/java/project/flipnote/group/repository/GroupMemberRepositoryImpl.java (2)
RequiredArgsConstructor(14-36)findGroupMembers(22-34)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (3)
src/main/java/project/flipnote/group/service/GroupService.java (3)
9-9: 변경 이상 없음해당 import 추가로 문제 되진 않습니다.
335-336: 페이징 응답 생성 로직 분리 좋습니다중복 제거 및 재사용성 향상. 이후 모든 리스트 API에 동일 헬퍼 적용 권장.
369-380: 사이즈 하한(@min(1)) 검증은 CursorPagingRequest에서 처리되므로 별도 추가 불필요
GroupListRequest가 CursorPagingRequest를 상속하며, 해당 클래스의 size 필드에 @min(1) 어노테이션이 적용되어 있어 req.getSize() ≥ 1이 보장됩니다.
📝 변경 내용
✅ 체크리스트
💬 기타 참고 사항
Summary by CodeRabbit