-
Notifications
You must be signed in to change notification settings - Fork 1
[Fix] 컬렉션 목록/자식 조회 — 권한 필터링을 앱단이 아니라 SQL에서 처리 #241
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
babae37
fix: 컬렉션 목록/자식 조회 권한 필터링을 앱단이 아니라 SQL에서 처리
kangcheolung 37c85e4
test: 컬렉션 목록/자식 조회 SQL화에 맞춰 테스트 재작성
kangcheolung ef87aa5
docs: #240 설계 문서 작성 및 관련 기존 문서 최신화
kangcheolung aefd8d9
docs: 문서 설명 추가
kangcheolung 0b91bed
fix: #240 CodeRabbit 지적 반영 — 빈 페이지 요청 시 totalElements 오답 수정
kangcheolung 5622980
test: #240 CodeRabbit 지적 반영 — 빈 페이지 count 폴백 회귀 테스트
kangcheolung a68ace3
docs: #240 CodeRabbit 지적 반영 — totalElements 버그 기록, 표 정확도, 코드펜스
kangcheolung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
backend/src/main/java/com/opensource/docgrid/domain/collection/repository/CollectionRow.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.opensource.docgrid.domain.collection.repository; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| /** | ||
| * 읽기 가능한 컬렉션 목록 네이티브 쿼리 프로젝션 (GET /collections). | ||
| * | ||
| * <p>컬럼 alias가 snake_case일 때 Spring Data JPA가 camelCase getter로 자동 매핑한다. | ||
| * totalCount는 COUNT(*) OVER()로 모든 행에 동일하게 실려오는 전체 개수다. | ||
| */ | ||
| public interface CollectionRow { | ||
| Long getCollectionId(); | ||
| String getName(); | ||
| String getDescription(); | ||
| Long getOwnerUserId(); | ||
| Long getParentCollectionId(); | ||
| String getVisibility(); | ||
| String getStatus(); | ||
| LocalDateTime getCreatedAt(); | ||
| Long getTotalCount(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
빈 페이지에서도 전체 개수를 반환하세요.
COUNT(*) OVER()는 반환 행이 있을 때만total_count를 제공합니다.OFFSET이 마지막 페이지를 넘으면 쿼리는 빈 목록을 반환하고,CollectionQueryService.getCollections()는 이를totalElements = 0으로 변환합니다. 실제 결과가 3개인 상태에서page=2, size=2를 요청하면 빈 콘텐츠와 함께 전체 개수도 0으로 응답합니다.빈 페이지에도 count를 전달하는 쿼리 형태를 사용하거나, 빈 결과일 때 정확한 count를 조회하세요. 이 경우를 검증하는 회귀 테스트도 추가하세요.
🤖 Prompt for AI Agents