Skip to content

Feature/#43 선수 포지션 리스트 가져오기 기능 개발 및 선수 검색 기능 수정 - #63

Merged
hwichoi0317 merged 3 commits into
devfrom
feature/#43
Aug 14, 2025
Merged

Feature/#43 선수 포지션 리스트 가져오기 기능 개발 및 선수 검색 기능 수정#63
hwichoi0317 merged 3 commits into
devfrom
feature/#43

Conversation

@hwichoi0317

@hwichoi0317 hwichoi0317 commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • 신기능
    • 요소 타입 목록 조회 API 추가: /api/elementType/all
    • 선수 검색 API 통합: 키워드와 요소 타입을 동시에 필터링하는 /api/playerEs/search 제공
  • 리팩터
    • 검색 동작 개선: 키워드 없으면 전체 조회, 있으면 영문/한글 이름 기반 매칭 강화
    • 검색 결과 최대 700건으로 제한
    • 기존 키워드 전용/요소 타입 전용 검색 엔드포인트 사용 중단 (통합 엔드포인트로 대체)

@coderabbitai

coderabbitai Bot commented Aug 14, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

신규 ElementType 목록 조회 API를 추가하고 DTO/서비스/엔티티 매퍼를 도입했다. PlayerEs 검색 엔드포인트와 서비스 로직을 통합하여 단일 검색 메서드/엔드포인트로 변경하고 기존 두 엔드포인트를 주석 처리했다.

Changes

Cohort / File(s) Summary of Changes
Elasticsearch 검색 통합
.../domain/player/elasticsearch/controller/PlayerEsController.java, .../domain/player/elasticsearch/service/PlayerEsService.java
GET /api/playerEs/search 추가(쿼리: keyword, elementTypeId). 기존 /searchWithKeyword, /searchWithElementTypeId 비활성화. 서비스 메서드 search(keyword, elementTypeId)로 통합하고 BoolQuery 기반으로 재작성, matchAll/term 조건 추가, size=700 고정.
ElementType 목록 API
.../domain/player/controller/ElementTypeController.java, .../domain/player/service/ElementTypeService.java, .../domain/player/dto/ElementTypeDto.java, .../domain/player/entity/ElementType.java
GET /api/elementType/all 추가. 서비스에서 findAll() 결과를 ElementType.toDtoList()로 변환 반환. DTO(ElementTypeDto) 신설. 엔티티에 DTO 리스트 변환 정적 메서드 추가.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Controller as PlayerEsController
  participant Service as PlayerEsService
  participant ES as Elasticsearch

  Client->>Controller: GET /api/playerEs/search?keyword=&elementTypeId=
  Controller->>Service: search(keyword, elementTypeId)
  alt both blank
    Service->>ES: match_all query (size=700)
  else keyword only
    Service->>ES: bool should(webName.ngram, krName.ngram) (min_should_match=1)
  else elementTypeId only
    Service->>ES: term query on elementTypeId.keyword
  else both provided
    Service->>ES: bool should(...) + must term(elementTypeId)
  end
  ES-->>Service: hits
  Service-->>Controller: List<PlayerEsDocument>
  Controller-->>Client: 200 OK
Loading
sequenceDiagram
  autonumber
  participant Client
  participant C as ElementTypeController
  participant S as ElementTypeService
  participant Repo as ElementTypeRepository
  participant Mapper as ElementType (toDtoList)

  Client->>C: GET /api/elementType/all
  C->>S: getAllElementType()
  S->>Repo: findAll()
  Repo-->>S: List<ElementType>
  S->>Mapper: toDtoList(elementTypes)
  Mapper-->>S: List<ElementTypeDto>
  S-->>C: List<ElementTypeDto>
  C-->>Client: 200 OK
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jaehyeok-code

Poem

새 탐색 길, 한 갈래로 정돈됐네—힙합!
타입 목록 툭, 토끼 발로 살짝 탭탭.
검색엔 불리 쿼리, 이름도 콕 집어냄,
엔티티는 DTO로 점프해 쉭—
당근깃발 펄럭, 릴리즈로 퐁당! 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b7e888 and ee60d4b.

📒 Files selected for processing (6)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/controller/ElementTypeController.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/dto/ElementTypeDto.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/elasticsearch/controller/PlayerEsController.java (2 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/elasticsearch/service/PlayerEsService.java (5 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/entity/ElementType.java (3 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/player/service/ElementTypeService.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#43

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hwichoi0317
hwichoi0317 merged commit e8a0600 into dev Aug 14, 2025
1 check was pending
@hwichoi0317
hwichoi0317 deleted the feature/#43 branch August 14, 2025 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant