Skip to content

Feat: 인기 검색어 조회 API 구현 - #346

Open
seoyeonjin wants to merge 6 commits into
devfrom
feat/#345
Open

seoyeonjin wants to merge 6 commits into
devfrom
feat/#345

Conversation

@seoyeonjin

@seoyeonjin seoyeonjin commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

🔥Pull requests

⛳️ 작업한 브랜치

👷 작업한 내용

  • popular_keyword 테이블 생성 및 임시 인기 검색어 5개 삽입 (Flyway V6)
  • 인기 검색어 조회 API 추가: GET /search/popular
    • 응답: { "keywords": ["강아지 설사", ...] } (배열 순서 = 순위, 최대 5개)
  • 비로그인 조회 허용 (SecurityConfig whitelist)
  • Swagger 문서 추가
  • 기능 정의서 추가: docs/popular-keyword.md

🚨 참고 사항

  • 키워드는 기획 확정 전 임시 데이터입니다. 확정 시 재배포 없이 SQL로 변경합니다.
    • 예: UPDATE popular_keyword SET keyword = '...' WHERE display_rank = 3;
  • 캐싱은 적용하지 않았습니다 (5행 인덱스 조회). 부하 발생 시 적용 순서는 정의서 2.5 참고.
  • 테스트는 H2 + Flyway 비활성 환경이라 V6 마이그레이션은 MySQL에서 미검증 → dev 배포 후 테이블/데이터 확인 필요

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 새 기능
    • 로그인 없이 커뮤니티 인기 검색어 상위 5개를 조회할 수 있습니다.
    • 인기 검색어를 선택해 기존 게시글 검색을 이용할 수 있습니다.
    • 인기 검색어는 초기 목록으로 제공되며, 순위에 따라 표시됩니다.

seoyeonjin and others added 6 commits September 24, 2026 22:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seoyeonjin seoyeonjin added the 🍀feat 기능 개발 label Sep 24, 2026
@seoyeonjin seoyeonjin self-assigned this Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0033d246-d328-4818-b7fe-11d5953e9160

📥 Commits

Reviewing files that changed from the base of the PR and between 11d1d24 and cbe9e44.

📒 Files selected for processing (9)
  • docs/popular-keyword.md
  • src/main/java/com/cocos/cocos/api/search/controller/SearchController.java
  • src/main/java/com/cocos/cocos/api/search/controller/SearchControllerSwagger.java
  • src/main/java/com/cocos/cocos/api/search/dto/response/PopularKeywordResponse.java
  • src/main/java/com/cocos/cocos/api/search/service/SearchService.java
  • src/main/java/com/cocos/cocos/config/SecurityConfig.java
  • src/main/java/com/cocos/cocos/db/search/entity/PopularKeyword.java
  • src/main/java/com/cocos/cocos/db/search/repository/PopularKeywordRepository.java
  • src/main/resources/db/migration/V6__create_popular_keyword_table.sql

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

인기 검색어를 저장하고 순위순 상위 5개를 반환하는 조회 API를 추가했습니다. 해당 API는 비로그인 접근을 허용하며, 응답 형식과 운영 규칙을 문서화했습니다.

Changes

인기 검색어 조회

Layer / File(s) Summary
저장 구조와 조회 쿼리
src/main/java/com/cocos/cocos/db/search/entity/PopularKeyword.java, src/main/resources/db/migration/V6__create_popular_keyword_table.sql, src/main/java/com/cocos/cocos/db/search/repository/PopularKeywordRepository.java
popular_keyword 테이블과 순위 고유 제약 조건을 추가했습니다. 임시 키워드 5개를 삽입하고, 표시 순위 오름차순 상위 5개를 조회하는 저장소 메서드를 추가했습니다.
순위별 응답 생성
src/main/java/com/cocos/cocos/api/search/dto/response/PopularKeywordResponse.java, src/main/java/com/cocos/cocos/api/search/service/SearchService.java
keywords 배열의 순서가 순위를 나타내는 응답 레코드를 추가했습니다. 서비스는 저장소에서 조회한 키워드로 응답을 생성합니다.
API 연결과 공개 설정
src/main/java/com/cocos/cocos/api/search/controller/SearchController.java, src/main/java/com/cocos/cocos/api/search/controller/SearchControllerSwagger.java, src/main/java/com/cocos/cocos/config/SecurityConfig.java, docs/popular-keyword.md
GET /search/popular 엔드포인트를 추가하고 비로그인 접근을 허용했습니다. Swagger 문서와 인기 검색어 운영 규칙 및 설계를 문서화했습니다.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant SearchController
  participant SearchService
  participant PopularKeywordRepository
  participant popular_keyword
  Client->>SearchController: GET /search/popular
  SearchController->>SearchService: getPopularKeywords()
  SearchService->>PopularKeywordRepository: findTop5ByOrderByDisplayRankAsc()
  PopularKeywordRepository->>popular_keyword: 순위 오름차순 상위 5개 조회
  popular_keyword-->>PopularKeywordRepository: 순위별 키워드
  PopularKeywordRepository-->>SearchService: 인기 검색어 목록
  SearchService-->>SearchController: PopularKeywordResponse
  SearchController-->>Client: 성공 응답
Loading

Merge Risk: ⚪ Minimal · up to cbe9e

The popular-keyword endpoint appears ready for normal merge checks. Verify the new table and initial data in the deployment environment as planned.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 7 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 인기 검색어 조회 API 구현이라는 PR의 주요 변경 사항을 명확하고 간결하게 설명합니다.
Description check ✅ Passed 설명은 템플릿의 필수 섹션을 모두 포함합니다. 작업 내용, API 경로, 보안 설정, 문서 추가, 임시 데이터와 테스트 제한 사항을 구체적으로 설명합니다.
Linked Issues check ✅ Passed 직접 연결된 이슈 #345의 모든 코딩 요구사항을 변경 사항이 충족합니다. V6__create_popular_keyword_table.sql이 popular_keyword 테이블과 순위 1~5의 임시 데이터를 생성합니다. GET /search/popular가 displayRank 오름차순으로 최대 5개 키워드를 반환합니다. `SecurityC…
Out of Scope Changes check ✅ Passed 변경 사항은 이슈 #345의 인기 검색어 테이블, 조회 API, 비로그인 접근, Swagger 문서 및 기능 정의서 범위에 해당합니다. 응답 DTO, 엔티티, 저장소, 서비스 추가는 해당 API 구현에 필요한 지원 변경입니다. 입증된 무관한 변경은 없습니다.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 7 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

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

Labels

🍀feat 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: 인기 검색어 조회 API 구현

1 participant