[Refactor] 카테고리 계층별 조회 구현#203
Merged
Merged
Conversation
Bal1oon
requested review from
Moses249 and
growingpsy
and removed request for
willjsw
October 25, 2025 13:00
growingpsy
pushed a commit
that referenced
this pull request
Oct 26, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🛠️ Issue Number
closes #202
📌 작업 내용 및 특이사항
기존 카테고리 조회는 "카테고리 전체 목록 조회", "카테고리 트리형 전체 조회" 뿐이라서 불필요하게 많은 데이터를 조회하는 문제점이 있어 리팩토링 진행하게 되었습니다. 다른 eCommerce의 카테고리 조회 형식을 참고하여 계층형 조회 구조로 변환했습니다.
변경 전: 1, 2, 3 depth 전부 조회
변경 후: 1 -> 2 -> 3 depth를 하나씩 펼치는 식으로 조회
Controller
/categorisAPI가 parentId 기반 조건으로 동작하도록 수정GET /categories: 루트 카테고리 조회GET /categories?parentId={id}: 특정 카테고리의 하위 카테고리 조회Service
findAllCategories()메서드 제거 및 메서드 분리findRootCategories(): 루트 카테고리 조회findByParentId(UUID parentId): 특정 카테고리 하위 조회Repository
findChildrenByParentId(UUID parentId)쿼리 메서드 재사용📚 참고사항
/categories/tree는 그대로 유지 (관리자용 전체 트리 조회) —@BatchSize설정 기반으로 Lazy 로딩 시 효율적 작동 확인