Skip to content

[category] 카테고리 전체 조회/검색 API 추가#45

Merged
jyx-07 merged 5 commits into
developfrom
feat/category-add-query-search-api
Jul 14, 2026
Merged

[category] 카테고리 전체 조회/검색 API 추가#45
jyx-07 merged 5 commits into
developfrom
feat/category-add-query-search-api

Conversation

@jyx-07

@jyx-07 jyx-07 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

개요

category 도메인에는 지금까지 domain / port/out / adapter/out(영속성) 계층만 존재하고, 카테고리를 직접 조회하는 GraphQL Query가 없었습니다. 이번 PR에서 전체 카테고리 목록 조회(categories)와 키워드 기반 검색(searchCategories) Query를 추가하였습니다.

변경 사항

  • CategoryPersistencePortfindAll(), searchByKeyword(keyword) 추가
  • CategoryPersistenceAdapterJPAQueryFactory 기반 QueryDSL 구현을 추가하였습니다 (categoryId 오름차순 정렬, 영문명/한글명 대소문자 무시 부분일치 검색). 기존 ScorePersistenceAdapter의 QueryDSL 사용 방식과 일관성을 맞추었습니다
  • FetchCategoriesUseCase/FetchCategoriesService, SearchCategoriesUseCase/SearchCategoriesService를 각각 추가하여 조회와 검색 책임을 분리하였습니다
  • CategoryPayload DTO와 Category.toPayload() 확장함수를 추가하였습니다. 기존 Category GraphQL 타입(Score에서 이미 사용 중)의 필드명을 그대로 쓰지 않고, 응답 전용 필드명(englishName, koreanName, maxRecordCount)으로 매핑하였고, 이후 다른 Mutation 호출 시 필요한 categoryType도 함께 포함하였습니다
  • CategoryWebAdaptercategories, searchCategories(keyword) Query 리졸버를 추가하였습니다
  • category.graphqlsCategoryPayload 타입과 extend type Query를 추가하였습니다
  • 관련 서비스/매핑 테스트 3종(FetchCategoriesServiceTest, SearchCategoriesServiceTest, CategoryPayloadTest)을 추가하였습니다
  • 구현 계획 문서(docs/plans/category-query-api-plan.md)를 추가하였습니다

참고 사항

  • searchCategories에 keyword를 전달하지 않거나 빈 문자열/공백을 전달하면 categories와 동일하게 전체 목록을 반환합니다
  • 인증은 기존 /graphql 엔드포인트의 JWT 인증 정책을 그대로 따르며, 역할별 제한은 두지 않았습니다
  • 단위 테스트와 전체 빌드는 통과를 확인하였으나, GraphiQL을 통한 실제 서버 기동 후 수동 검증은 아직 진행하지 못했습니다

체크리스트

  • 이 작업으로 인해 변경이 필요한 문서를 작성 또는 수정했나요? (e.g. README, .env.example)
  • 작업한 코드가 정상적으로 동작하는지 확인했나요?
  • 작업한 코드에 대한 테스트 코드를 작성하거나 수정했나요?
  • Merge 대상 브랜치를 올바르게 설정했나요?
  • 해당 PR과 관련 없는 작업이 포함되지는 않았나요?
  • PR의 올바른 라벨과 리뷰어를 설정했나요?

@jyx-07 jyx-07 added the 📩 Type: Feature/Function 새로운 기능 및 개선 사항 label Jul 14, 2026
@github-actions github-actions Bot added the 🌟 Status: Reviewing 리뷰 중인 이슈 label Jul 14, 2026
@jyx-07 jyx-07 self-assigned this Jul 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements the Category Query and Search APIs by introducing new inbound use cases, services, and a GraphQL web adapter. It also extends the outbound persistence layer with QueryDSL-based queries to fetch all categories or search them by keyword. The feedback suggests trimming the search keyword in SearchCategoriesService to handle leading or trailing whitespaces robustly, along with updating the unit tests to verify this behavior.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@jyx-07

jyx-07 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements the category query and search APIs, including the addition of a detailed implementation plan, GraphQL schema updates, UseCases, services, and QueryDSL-based persistence adapters. The reviewer suggested optimizing the read-only operations in FetchCategoriesService and SearchCategoriesService by adding the @transactional(readOnly = true) annotation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@jyx-07
jyx-07 merged commit 021ca61 into develop Jul 14, 2026
4 checks passed
@jyx-07
jyx-07 deleted the feat/category-add-query-search-api branch July 14, 2026 06:03
@github-actions github-actions Bot added 🌟 Status: Done 리뷰까지 완료된 이슈 and removed 🌟 Status: Reviewing 리뷰 중인 이슈 labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 Status: Done 리뷰까지 완료된 이슈 📩 Type: Feature/Function 새로운 기능 및 개선 사항

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants