Skip to content

Conversation

@stoneTiger0912
Copy link
Member

@stoneTiger0912 stoneTiger0912 commented Aug 28, 2025

📝 변경 내용


✅ 체크리스트

  • 코드가 정상적으로 동작함
  • 테스트 코드 통과함
  • 문서(README 등)를 최신화함
  • 코드 스타일 가이드 준수

💬 기타 참고 사항

Summary by CodeRabbit

  • 신기능
    • 내 그룹 목록 조회 엔드포인트(/v1/groups/me) 추가: 로그인한 사용자가 속한 그룹만 반환
    • 카테고리 필터 및 커서 기반 페이지네이션 지원(hasNext, nextCursor 유지)
    • 그룹 기본 정보(이름, 설명, 카테고리, 이미지 등) 반환
    • 기존 공개 그룹 목록 엔드포인트 동작에는 영향 없음

@stoneTiger0912 stoneTiger0912 self-assigned this Aug 28, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

인증 사용자 전용 그룹 조회 기능을 추가했다. 컨트롤러에 GET /v1/groups/me 엔드포인트를 신설하고, 서비스와 리포지토리에 사용자 ID 기반 커서 페이지네이션 조회 로직을 추가했으며, 공용 페이지 응답 생성 로직을 헬퍼 메서드로 추출했다.

Changes

Cohort / File(s) Change summary
Controller: 내 그룹 조회 엔드포인트
src/main/java/project/flipnote/group/controller/GroupController.java
GET /v1/groups/me 추가: findMyGroup(AuthPrinciple, @Valid @ModelAttribute GroupListRequest)groupService.findMyGroup(...) 위임, ResponseEntity<CursorPagingResponse<GroupInfo>> 반환
Service: 비즈니스 로직 및 공통 페이징 헬퍼
src/main/java/project/flipnote/group/service/GroupService.java
findMyGroup(...) 신설(사용자 소속 그룹 커서 조회). 기존 findGroup의 페이징 생성 로직을 createGroupInfoCursorPagingResponse(...) 헬퍼로 추출/재사용
Repository API: 사용자 필터 추가
src/main/java/project/flipnote/group/repository/GroupRepositoryCustom.java
메서드 추가: findAllByCursorAndUserId(Long lastId, Category category, int pageSize, Long userId)
Repository Impl: 멤버십 조인 기반 조회
src/main/java/project/flipnote/group/repository/GroupRepositoryImpl.java
QGroupMember 조인 도입. findAllByCursorAndUserId(...) 구현: 삭제 여부/카테고리/커서 필터 재사용, 멤버십(userId) 조건 추가, id desc 정렬, limit(pageSize+1)

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)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • dungbik

Poem

토끼가 깡총 /v1/groups/me를 누르네 🥕
내 멤버십 따라 쏙쏙 조회해, hop hop
커서로 살금 다음 점프 준비하네
목록 한정, 다음 ID 주머니에 쏙
당근 한입에 코드도 깔끔히!

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 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 1bce59f and 4bfef46.

📒 Files selected for processing (1)
  • src/main/java/project/flipnote/group/repository/GroupRepositoryImpl.java (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/project/flipnote/group/repository/GroupRepositoryImpl.java
⏰ 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
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/find-my-group

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 or @coderabbit 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.

Copy link

@coderabbitai coderabbitai bot left a 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 28997c8 and 1bce59f.

📒 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이 보장됩니다.

@stoneTiger0912 stoneTiger0912 added the enhancement New feature or request label Aug 31, 2025
@stoneTiger0912 stoneTiger0912 merged commit b467330 into develop Aug 31, 2025
3 checks passed
@stoneTiger0912 stoneTiger0912 deleted the feat/find-my-group branch August 31, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants