Skip to content

feat: 채널 목록 조회에 업종 필터 추가 - #134

Open
1117mg wants to merge 1 commit into
devfrom
feat/131-channel-list-category-filter
Open

feat: 채널 목록 조회에 업종 필터 추가#134
1117mg wants to merge 1 commit into
devfrom
feat/131-channel-list-category-filter

Conversation

@1117mg

@1117mg 1117mg commented Aug 7, 2026

Copy link
Copy Markdown
Member

🔗 관련 이슈

Closes #131

📝 작업 내용

  • 채널 목록 조회에 primaryCategory 필터 추가 (다중 선택 지원)
  • name과 함께 보내면 두 조건 모두 만족하는 채널만 응답
  • 요청 예시
    GET /api/v1/channels?primaryCategory=SHOPPING_COMMERCE
    GET /api/v1/channels?primaryCategory=SHOPPING_COMMERCE&primaryCategory=GAME
    GET /api/v1/channels?primaryCategory=SHOPPING_COMMERCE,GAME
    GET /api/v1/channels?name=11번가&primaryCategory=SHOPPING_COMMERCE

✅ 체크리스트

  • 로컬에서 빌드 및 테스트가 통과했습니다.
  • 컨벤션(브랜치/커밋 메시지)을 준수했습니다.
  • 관련 문서를 수정했습니다. (필요한 경우)

Summary by CodeRabbit

  • 새로운 기능

    • 채널 목록 조회 시 대표 업종으로 필터링할 수 있습니다.
    • 여러 대표 업종을 반복 입력하거나 쉼표로 구분해 검색할 수 있습니다.
    • 채널명과 대표 업종을 함께 조건으로 지정할 수 있습니다.
    • 대표 업종 조건이 없으면 기존처럼 전체 활성 채널을 조회합니다.
  • 문서

    • 대표 업종 검색 파라미터의 입력 방식과 동작을 API 문서에 반영했습니다.

@1117mg 1117mg self-assigned this Aug 7, 2026
@1117mg 1117mg added the feat label Aug 7, 2026
@1117mg
1117mg requested a review from SinnoLn August 7, 2026 11:41
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

채널 목록 조회 API에 primaryCategory 필터를 추가했습니다. 반복 파라미터와 쉼표 구분 입력을 Category 목록으로 변환합니다. 저장소는 활성 채널 조회와 count 조회에 카테고리 조건을 적용합니다. 관련 컨트롤러 및 저장소 테스트를 갱신했습니다.

Changes

채널 대표 업종 필터

Layer / File(s) Summary
요청 및 서비스 필터 계약
src/main/java/chaeso/zip/server/channel/presentation/dto/ChannelSearchRequest.java, src/main/java/chaeso/zip/server/channel/presentation/ChannelController.java, src/main/java/chaeso/zip/server/channel/application/*, src/main/java/chaeso/zip/server/channel/presentation/ChannelApiDocs.java
검색 요청에 primaryCategory 목록을 추가했습니다. 컨트롤러는 해당 목록을 ChannelService.getChannels에 전달합니다. API 문서는 반복 입력과 쉼표 구분 입력을 설명합니다.
저장소 카테고리 검색 조건
src/main/java/chaeso/zip/server/channel/domain/repository/*
활성 채널 조회와 count 조회에 대표 업종 조건을 추가했습니다. 목록이 null 또는 비어 있으면 조건을 생략합니다.
필터 입력 및 검색 검증
src/test/java/chaeso/zip/server/channel/domain/ChannelRepositoryTest.java, src/test/java/chaeso/zip/server/channel/presentation/ChannelControllerTest.java
단일·복수·빈 업종 조건과 채널명 조합을 검증합니다. 반복 및 쉼표 구분 입력의 변환과 잘못된 업종 코드의 400 응답을 검증합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ChannelController
  participant ChannelService
  participant ChannelRepositoryImpl
  participant ChannelQuery
  Client->>ChannelController: primaryCategory 입력
  ChannelController->>ChannelService: getChannels(name, primaryCategories, pageable)
  ChannelService->>ChannelRepositoryImpl: searchActiveChannels(name, primaryCategories, pageable)
  ChannelRepositoryImpl->>ChannelQuery: 활성 상태와 카테고리 조건으로 조회
  ChannelQuery-->>ChannelRepositoryImpl: 채널 결과와 전체 개수
  ChannelRepositoryImpl-->>ChannelService: 페이지 결과 반환
  ChannelService-->>ChannelController: 채널 페이지 반환
  ChannelController-->>Client: 채널 목록 응답
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed [\#131]의 primaryCategory 기반 채널 필터링 요구를 구현했으며, 다중 선택과 name 조합 조건 및 테스트를 포함합니다.
Out of Scope Changes check ✅ Passed 변경 사항은 primaryCategory 필터 구현, API 문서 갱신, 관련 테스트 수정 및 추가 범위로 제한됩니다.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 채널 목록 조회 API에 업종 필터를 추가하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/131-channel-list-category-filter

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

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.14%. Comparing base (051ee55) to head (d940392).

Files with missing lines Patch % Lines
...annel/domain/repository/ChannelRepositoryImpl.java 0.00% 6 Missing ⚠️
...server/channel/application/ChannelServiceImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #134      +/-   ##
============================================
- Coverage     88.44%   88.14%   -0.31%     
  Complexity      469      469              
============================================
  Files           105      105              
  Lines          1437     1442       +5     
  Branches        111      111              
============================================
  Hits           1271     1271              
- Misses          122      127       +5     
  Partials         44       44              
Files with missing lines Coverage Δ
...server/channel/presentation/ChannelController.java 100.00% <100.00%> (ø)
...server/channel/application/ChannelServiceImpl.java 0.00% <0.00%> (ø)
...annel/domain/repository/ChannelRepositoryImpl.java 3.12% <0.00%> (-0.45%) ⬇️
Components Coverage Δ
auth 93.62% <ø> (ø)
channel 52.54% <20.00%> (-2.33%) ⬇️
onboarding 87.37% <ø> (ø)
estimation 93.08% <ø> (ø)
performance 88.00% <ø> (ø)
simulation 93.08% <ø> (ø)
user 89.65% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/java/chaeso/zip/server/channel/presentation/ChannelApiDocs.java`:
- Around line 126-127: Update the API description near the primaryCategory
filter in ChannelApiDocs to explicitly state that primaryCategory and name are
combined with an AND condition, so both filters must match when provided
together. Use valid Category examples such as SHOPPING_COMMERCE and GAME instead
of A and B.

In `@src/test/java/chaeso/zip/server/channel/domain/ChannelRepositoryTest.java`:
- Around line 87-92: Replace the assumeTrue guard in the multi-category test
with a failing assertion that requires categories.size() to equal 2, so
insufficient fixture data fails the test instead of skipping it; keep the
existing activeChannels category collection unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 77f38bb0-7e60-466d-acaf-e0209e69f3da

📥 Commits

Reviewing files that changed from the base of the PR and between 051ee55 and d940392.

📒 Files selected for processing (9)
  • src/main/java/chaeso/zip/server/channel/application/ChannelService.java
  • src/main/java/chaeso/zip/server/channel/application/ChannelServiceImpl.java
  • src/main/java/chaeso/zip/server/channel/domain/repository/ChannelRepositoryCustom.java
  • src/main/java/chaeso/zip/server/channel/domain/repository/ChannelRepositoryImpl.java
  • src/main/java/chaeso/zip/server/channel/presentation/ChannelApiDocs.java
  • src/main/java/chaeso/zip/server/channel/presentation/ChannelController.java
  • src/main/java/chaeso/zip/server/channel/presentation/dto/ChannelSearchRequest.java
  • src/test/java/chaeso/zip/server/channel/domain/ChannelRepositoryTest.java
  • src/test/java/chaeso/zip/server/channel/presentation/ChannelControllerTest.java

@claude

claude Bot commented Aug 7, 2026

Copy link
Copy Markdown

🔎 PR 리뷰 결과

머지를 막을 만한 문제를 찾지 못했습니다.

확인한 항목

  • 계층 아키텍처(ArchUnit 규칙): presentation → application → domain 방향 준수, primaryCategory 필터가 각 계층 시그니처(Controller → Service → Repository)로 일관되게 전달됨
  • JPA/QueryDSL: primaryCategoryIn이 null/빈 리스트일 때 조건을 걸지 않아 카운트 쿼리와 컨텐츠 쿼리에 동일하게 적용됨. N+1 등 새로 유입된 문제 없음
  • 잘못된 업종 코드값(primaryCategory=NOT_A_CATEGORY) 입력 시 record 생성자 바인딩 실패 → MethodArgumentNotValidExceptionGlobalExceptionHandler가 공통 400/C-001 포맷으로 매핑하는 기존 컨벤션과 일치
  • 테스트: 리포지토리 계층(단일/다중 업종, name과 결합, 빈 리스트)과 컨트롤러 계층(반복 파라미터, 쉼표 구분, 잘못된 값) 모두 의미 있는 케이스로 커버됨

머지해도 좋습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants