Skip to content

Refactor: Store 응답 필드에 학과 이름 추가#133

Merged
Jjiggu merged 8 commits into
developfrom
refactor/#132-add-department-filed
Jul 22, 2025
Merged

Refactor: Store 응답 필드에 학과 이름 추가#133
Jjiggu merged 8 commits into
developfrom
refactor/#132-add-department-filed

Conversation

@Jjiggu

@Jjiggu Jjiggu commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

작업 요약

  • 주점 조회 엔드포인트 수정
  • Store 전체 조회 응답 필드에 DepartmentName 추가
  • N + 1 문제 해결
  • 학과 이름 포함하여 조회하는 getAllStoresByPageAndDeparments 추가

Issue Link

#132

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 신규 기능

    • 매장 목록을 부서별로 페이지네이션하여 조회하는 새로운 엔드포인트가 추가되었습니다.
    • 매장 정보를 부서명 및 이미지와 함께 상세하게 제공하는 새로운 응답 형식이 도입되었습니다.
    • 여러 매장의 이미지를 한 번에 조회할 수 있는 기능이 추가되었습니다.
  • 기능 개선

    • 매장 이미지 업로드 응답에 storeId가 포함되어 더 많은 정보를 제공합니다.
    • 매장 검색 결과가 부서명 및 이미지 정보를 포함하도록 개선되었습니다.
  • 버그 수정/기타

    • 일부 내부 코드 스타일 및 import 방식이 개선되었습니다.
    • CORS 허용 URL 구분자에 공백이 추가되어 가독성이 향상되었습니다.

@Jjiggu Jjiggu self-assigned this Jul 22, 2025
@Jjiggu Jjiggu added the refactor 리팩토링 label Jul 22, 2025
@coderabbitai

coderabbitai Bot commented Jul 22, 2025

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

"""

Walkthrough

이번 변경 사항은 매장(스토어) 관련 API의 페이징 및 부서(Department) 정보를 포함한 조회 기능을 확장하고, 관련 DTO 및 서비스 계층을 개선하는 내용입니다. 또한, 이미지 및 부서 조회를 위한 레포지토리 메서드가 추가되고, 기존 DTO와 서비스 메서드 일부가 리팩토링되었습니다.

Changes

파일/경로 그룹 변경 요약
.../config/security/CorsConfig.java CORS 허용 origin 리스트의 쉼표 뒤에 공백 추가 (포맷팅 변경, 기능 변화 없음)
.../store/controller/StoreController.java 페이징+부서별 매장 조회 엔드포인트(/all-stores/infinite-scroll) 추가, 기존 페이징 엔드포인트 리네이밍 및 서비스 호출 분리
.../store/dto/StoreDepartmentReadResponse.java
.../store/dto/StorePageReadDto.java
부서명 및 페이징 정보 포함 응답용 DTO(StoreDepartmentReadResponse, StorePageReadDto) 신규 추가
.../store/dto/StoreImageUploadResponse.java storeId 필드 추가, fromEntity 팩토리 메서드에서 storeId 설정 추가
.../store/service/StoreService.java getAllStoresByPageAndDeparments(Pageable) 메서드 추가, searchStoresByName 반환 타입 변경
.../store/service/StoreServiceImpl.java 위 인터페이스 변경 반영, 신규 페이징+부서별 조회 메서드 구현, 이미지/부서 정보 일괄 조회로 리팩토링
.../department/repository/DepartmentRepository.java Department 엔티티 import 및 제네릭 타입 단순화 (기능 변화 없음)
.../store/repository/StoreImageRepository.java 매장 ID 리스트로 이미지 일괄 조회하는 findByStore_StoreIdIn(List<Long>) 메서드 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant StoreController
    participant StoreServiceImpl
    participant StoreRepository
    participant StoreImageRepository
    participant DepartmentRepository

    Client->>StoreController: GET /all-stores/infinite-scroll?page=...
    StoreController->>StoreServiceImpl: getAllStoresByPageAndDeparments(pageable)
    StoreServiceImpl->>StoreRepository: findAll(pageable)
    StoreServiceImpl->>StoreImageRepository: findByStore_StoreIdIn(storeIds)
    StoreServiceImpl->>DepartmentRepository: findAllById(departmentIds)
    StoreServiceImpl-->>StoreController: StoreDepartmentReadResponse
    StoreController-->>Client: 응답 반환
Loading

Estimated code review effort

3 (~45분)

Possibly related PRs

Suggested labels

enhancement
"""


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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@Jjiggu Jjiggu merged commit b4fa949 into develop Jul 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant