-
Notifications
You must be signed in to change notification settings - Fork 0
Fix: [FN-221] 내가 생성한 그룹 전체 조회 #53
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인증된 사용자가 생성한 그룹을 조회하는 새 API가 추가되었습니다. GET /v1/groups/created 엔드포인트가 GroupController에 추가되고, GroupService와 GroupRepository(Custom/Impl)에 대응 메서드들이 추가되어 생성자(Owner) 기준의 커서 기반 페이징 조회를 수행합니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Controller as GroupController
participant Service as GroupService
participant Repo as GroupRepositoryImpl
participant DB as Database
Client->>Controller: GET /v1/groups/created?(category,cursor,size)
Controller->>Service: findCreatedGroup(authPrinciple, request)
Service->>Service: category 변환 및 파라미터 준비
Service->>Repo: findAllByCursorAndCreatedUserId(cursorId, category, size, userId)
Repo->>DB: Query (join GroupMember where role = OWNER, optional cursor/category, left join imageRef)
DB-->>Repo: List<GroupInfo>
Repo-->>Service: List<GroupInfo>
Service->>Service: CursorPagingResponse 생성 (pageSize + 1 처리)
Service-->>Controller: CursorPagingResponse<GroupInfo>
Controller-->>Client: 200 OK + Response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/main/java/project/flipnote/group/service/GroupService.java (1)
467-479: 코드 중복을 리팩토링하는 것을 권장합니다.
findCreatedGroup메서드가findMyGroup(439-450번 라인)과 거의 동일한 구조를 가지고 있습니다. 466번 라인의 "//리팩토링" 주석이 이를 인지하고 있음을 보여줍니다. 공통 로직을 추출하여 중복을 제거하는 것을 고려해보세요.예를 들어, 다음과 같이 공통 메서드를 추출할 수 있습니다:
private CursorPagingResponse<GroupInfo> findGroupsWithFilter( AuthPrinciple authPrinciple, GroupListRequest req, BiFunction<Long, Category, List<GroupInfo>> repositoryMethod) { UserProfile user = getUser(authPrinciple); Category category = convertCategory(req.getCategory()); List<GroupInfo> groups = repositoryMethod.apply(category, req.getSize()); return createGroupInfoCursorPagingResponse(req, groups); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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(2 hunks)src/main/java/project/flipnote/group/service/GroupService.java(2 hunks)
⏰ 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/controller/GroupController.java (1)
110-119: 새로운 엔드포인트 구현이 적절합니다.내가 생성한 그룹 조회 엔드포인트가 기존 패턴을 잘 따르고 있으며, 인증 및 유효성 검증이 올바르게 적용되었습니다.
src/main/java/project/flipnote/group/repository/GroupRepositoryCustom.java (1)
15-15: 메서드 선언이 적절합니다.새로운 메서드 시그니처가 기존 메서드들과 일관성 있게 정의되었습니다.
src/main/java/project/flipnote/group/repository/GroupRepositoryImpl.java (1)
103-129: 구현 로직이 올바릅니다.OWNER 역할을 가진 사용자가 생성한 그룹만 필터링하는 로직이 정확하게 구현되었습니다. 기존
findAllByCursorAndUserId메서드와의 차이점(모든 역할 vs OWNER만)이 명확하게 반영되어 있습니다.
src/main/java/project/flipnote/group/repository/GroupRepositoryCustom.java
Outdated
Show resolved
Hide resolved
| /** | ||
| * 그룹 테이블에 생성한 유저 추가? | ||
| * @param lastId | ||
| * @param category | ||
| * @param pageSize | ||
| * @param userId | ||
| * @return | ||
| */ |
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.
Javadoc을 명확하게 작성하세요.
Javadoc 주석이 불명확합니다. "그룹 테이블에 생성한 유저 추가?"라는 질문 형태의 설명은 메서드의 목적을 명확히 전달하지 못합니다.
다음과 같이 수정하는 것을 권장합니다:
/**
- * 그룹 테이블에 생성한 유저 추가?
+ * 특정 사용자가 생성한(OWNER 역할) 그룹 목록을 커서 기반 페이징으로 조회합니다.
+ *
* @param lastId 마지막으로 조회된 그룹 ID (커서)
* @param category 필터링할 카테고리 (선택사항)
* @param pageSize 페이지 크기
- * @param userId
- * @return
+ * @param userId 그룹을 생성한 사용자 ID
+ * @return 조회된 그룹 정보 리스트
*/🤖 Prompt for AI Agents
In src/main/java/project/flipnote/group/repository/GroupRepositoryImpl.java
around lines 94 to 101, replace the ambiguous question-style Javadoc with a
clear method description and parameter/return details: state the method’s
purpose in one sentence (e.g., what it retrieves or modifies in the group
table), document each parameter (lastId, category, pageSize, userId) with
types/semantics and any nullable/optional behavior, describe the return value
and its contents (e.g., list of groups, paging token), and note any thrown
exceptions or side effects; keep it concise, use imperative form, and localize
language consistently (Korean or English) to match project conventions.
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: 0
🧹 Nitpick comments (1)
src/main/java/project/flipnote/group/service/GroupService.java (1)
464-478:findCreatedGroup구현이 기존 패턴과 잘 맞고, 기능적으로 문제 없어 보입니다
findMyGroup/findGroup과 동일한 플로우(유저 조회 → 카테고리 변환 → 커서 페이징 → 공통 응답 생성)를 그대로 따르고 있어서 서비스 레이어 일관성이 좋습니다. 새 레포지토리 메서드 호출부도 커서/카테고리/size/userId 인자 순서가 다른 메서드들과 정합적으로 보입니다.다만, 아래 두 가지는 향후 리팩토링 후보로 한 번 고려해볼 만합니다.
//리팩토링주석은 의미가 모호해서, 아예 제거하거나// 내가 생성한 그룹 목록 조회처럼 역할이 드러나게 바꾸면 가독성이 조금 좋아질 것 같습니다.findMyGroup와findCreatedGroup가 거의 동일한 구조라,
- 공통 private 메서드로 추출하거나,
- 혹은
validateUser(authPrinciple)+authPrinciple.userId()조합을 쓰도록 통일해서 불필요한UserProfile조회를 줄이는 것도 선택지입니다.
(지금 상태도 성능상 큰 문제는 없어 보이므로 필수는 아닙니다.)전체적으로 이 메서드 추가만으로는 버그나 예외적인 동작은 보이지 않습니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/project/flipnote/group/repository/GroupRepositoryCustom.java(1 hunks)src/main/java/project/flipnote/group/service/GroupService.java(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/main/java/project/flipnote/group/repository/GroupRepositoryCustom.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
📝 변경 내용
✅ 체크리스트
💬 기타 참고 사항
Summary by CodeRabbit
릴리스 노트
✏️ Tip: You can customize this high-level summary in your review settings.
✏️ Tip: You can customize this high-level summary in your review settings.