-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 가게 이미지 조회 API 구현 #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough가게에 달린 응원 이미지들을 조회하는 새로운 API가 추가되었습니다. 이를 위해 컨트롤러, 서비스, 레포지토리, DTO가 신설 및 확장되었으며, 이에 대한 단위 테스트, 통합 테스트, 문서화 테스트가 함께 도입되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant StoreController
participant StoreService
participant CheerRepository
participant ImageStorage
Client->>StoreController: GET /api/shops/{storeId}/images
StoreController->>StoreService: getStoreImages(storeId)
StoreService->>CheerRepository: findAllImageKey(store)
CheerRepository-->>StoreService: List<ImageKey>
loop for each imageKey
StoreService->>ImageStorage: getPresignedUrl(imageKey)
ImageStorage-->>StoreService: String (imageUrl)
end
StoreService-->>StoreController: ImagesResponse(List<String> imageUrls)
StoreController-->>Client: 200 OK + ImagesResponse
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(해당 변경사항에서 범위 밖의 변경은 발견되지 않았습니다.) Suggested labels
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (5)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/eatda/controller/store/StoreController.java (1)
20-23: REST API 엔드포인트가 적절히 구현되었습니다.RESTful 패턴을 잘 따르고 있으며 서비스 계층으로의 위임도 적절합니다.
입력 검증을 위해
@PathVariable에@Positive어노테이션 추가를 고려해보세요:-public ResponseEntity<ImagesResponse> getStoreImages(@PathVariable long storeId) { +public ResponseEntity<ImagesResponse> getStoreImages(@PathVariable @Positive long storeId) {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
src/main/java/eatda/controller/store/ImagesResponse.java(1 hunks)src/main/java/eatda/controller/store/StoreController.java(2 hunks)src/main/java/eatda/repository/store/CheerRepository.java(2 hunks)src/main/java/eatda/repository/store/StoreRepository.java(1 hunks)src/main/java/eatda/service/store/StoreService.java(2 hunks)src/test/java/eatda/controller/store/StoreControllerTest.java(1 hunks)src/test/java/eatda/document/store/StoreDocumentTest.java(2 hunks)src/test/java/eatda/repository/store/CheerRepositoryTest.java(3 hunks)src/test/java/eatda/service/store/StoreServiceTest.java(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
src/main/java/eatda/service/store/StoreService.java (2)
Learnt from: leegwichan
PR: #60
File: src/main/java/eatda/client/map/MapClient.java:24-41
Timestamp: 2025-07-09T07:54:18.446Z
Learning: In MapClient.java, the developer prefers to keep Kakao API-specific values (baseUrl, pageSize) hardcoded rather than extracting them to configuration properties, as these values are inherently tied to the Kakao API specification.
Learnt from: leegwichan
PR: #90
File: src/main/java/eatda/service/store/CheerService.java:35-46
Timestamp: 2025-07-20T05:38:13.430Z
Learning: CheerService에서 각 컴포넌트(storeSearchFilter, memberRepository, imageService)들이 자신의 책임 범위 내에서 검증을 수행하므로 서비스 레이어에서 추가적인 중복 검증이 불필요함. 각 레이어의 책임 분리가 잘 되어 있는 구조.
src/test/java/eatda/service/store/StoreServiceTest.java (1)
Learnt from: leegwichan
PR: #60
File: src/test/java/eatda/controller/store/StoreControllerTest.java:10-32
Timestamp: 2025-07-09T07:56:50.612Z
Learning: 컨트롤러 테스트에서 MockitoBean으로 의존성을 모킹한 경우, 상세한 비즈니스 로직 검증보다는 컨트롤러 계층의 동작(라우팅, 파라미터 처리, 응답 구조 등)을 검증하는 것이 더 적절합니다. 모킹된 데이터에 대한 상세 검증은 의미가 없기 때문입니다.
🧬 Code Graph Analysis (1)
src/test/java/eatda/document/store/StoreDocumentTest.java (1)
src/test/java/eatda/controller/store/StoreControllerTest.java (3)
Nested(15-49)Nested(51-80)Nested(82-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (17)
src/main/java/eatda/controller/store/ImagesResponse.java (1)
5-6: 깔끔한 레코드 정의입니다.이미지 URL 목록을 담는 응답 DTO로 적절하게 구현되었습니다. 레코드를 사용한 불변 데이터 전달 객체로서 간결하고 명확합니다.
src/main/java/eatda/service/store/StoreService.java (1)
32-39: 가게 이미지 조회 로직이 잘 구현되었습니다.메서드 구현이 명확하고 효율적입니다:
storeRepository.getById()를 통한 적절한 예외 처리- 스트림을 활용한 깔끔한 데이터 변환
- 메서드 참조 사용으로 가독성 향상
src/test/java/eatda/service/store/StoreServiceTest.java (1)
26-60: 포괄적인 테스트 커버리지를 제공합니다.세 가지 시나리오를 모두 적절히 테스트하고 있습니다:
- 정상 케이스: 여러 이미지 존재 시
- 엣지 케이스: 이미지가 없는 경우
- 예외 케이스: 존재하지 않는 가게 ID
테스트 구조와 검증 로직이 명확하고 적절합니다.
src/test/java/eatda/controller/store/StoreControllerTest.java (1)
15-49: 컨트롤러 테스트가 적절히 구현되었습니다.REST Assured를 활용한 HTTP 테스트가 잘 구성되어 있으며, 컨트롤러 계층의 동작(라우팅, 응답 구조, 상태 코드)을 적절히 검증하고 있습니다. 이미지가 있는 경우와 없는 경우 모두 커버하여 좋은 테스트 커버리지를 제공합니다.
src/test/java/eatda/repository/store/CheerRepositoryTest.java (3)
9-9: LGTM!새로운
findAllImageKey메서드 테스트를 위해 필요한 import 추가입니다.
30-32: 테스트 가독성 개선ImageKey 객체 전체를 비교하는 대신 실제 값을 추출하여 비교하도록 개선되었습니다. 테스트의 의도가 더 명확해졌습니다.
49-80: 새로운 findAllImageKey 메서드에 대한 포괄적인 테스트새로운
findAllImageKey메서드에 대해 성공 케이스와 빈 결과 케이스를 모두 적절히 테스트하고 있습니다. 테스트 구조와 assertion이 올바르게 작성되었습니다.참고:
Thread.sleep(5)는 테스트에서 순서를 보장하기 위한 일반적인 방법이지만, 테스트 실행 시간을 늘리고 가끔 불안정할 수 있습니다. 현재 상황에서는 허용 가능하지만, 향후 더 나은 대안(예: 명시적인 시간 설정)을 고려해볼 수 있습니다.src/main/java/eatda/repository/store/StoreRepository.java (3)
11-11: JpaRepository로 마이그레이션 - 좋은 개선사항
Repository에서JpaRepository로 변경하여 표준 CRUD 메서드들을 상속받도록 개선되었습니다. 명시적인save메서드 선언이 불필요해졌고, Spring Data JPA 컨벤션을 따릅니다.
4-5: 필요한 import 추가새로운
getById메서드의 예외 처리와 JpaRepository 상속을 위해 필요한 import들이 적절히 추가되었습니다.Also applies to: 9-9
13-17: 도메인별 예외 처리를 제공하는 잘 구현된 메서드
findById를 사용하여 Optional을 적절한 도메인 예외로 변환하는 표준적인 패턴을 따릅니다.STORE_NOT_FOUND에러 코드를 사용한 예외 처리가 적절합니다.src/main/java/eatda/repository/store/CheerRepository.java (3)
13-13: StoreRepository와 일관된 JpaRepository 마이그레이션
Repository에서JpaRepository로 변경하여 표준 CRUD 메서드들을 상속받도록 개선되었습니다. StoreRepository와 동일한 패턴을 따라 일관성이 유지됩니다.
10-10: JpaRepository 상속을 위한 필요한 importJpaRepository 상속을 위해 필요한 import가 적절히 추가되었습니다.
24-28: 기존 메서드와 일관된 새로운 쿼리 메서드
findRecentImageKey와 유사한 패턴을 따르면서 모든 이미지 키를 반환하는 메서드입니다. JPQL 쿼리가 올바르게 작성되었고, 정렬 순서와 필터링 조건이 기존 메서드와 일관됩니다.src/test/java/eatda/document/store/StoreDocumentTest.java (4)
15-15: 새로운 API 응답 타입을 위한 import 추가새로운 가게 이미지 조회 API의 응답 타입인
ImagesResponse를 위한 필요한 import입니다.
39-49: 적절한 REST Docs 문서화 설정요청/응답 문서화가 다른 엔드포인트들과 일관된 패턴을 따르고 있습니다. path parameter와 response field에 대한 설명이 명확합니다.
51-71: 성공 케이스에 대한 적절한 테스트서비스 레이어를 적절히 모킹하고 REST Docs 문서화를 포함한 통합 테스트가 잘 작성되었습니다. 실제적인 예시 데이터를 사용하여 테스트합니다.
73-89: 에러 케이스에 대한 포괄적인 테스트
STORE_NOT_FOUND에러에 대한 매개변수화된 테스트가 적절히 구현되었습니다. 서비스 예외를 모킹하고 올바른 상태 코드를 검증합니다.
lvalentine6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이번 PR도 고생하셨습니다! 🎉
LGTM!
# Conflicts: # src/main/java/eatda/service/store/StoreService.java # src/test/java/eatda/controller/store/StoreControllerTest.java # src/test/java/eatda/document/store/StoreDocumentTest.java # src/test/java/eatda/service/store/StoreServiceTest.java
|
|
🎉 This PR is included in version 1.4.0-develop.31 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



✨ 개요
🧾 관련 이슈
closed #98
🔍 참고 사항 (선택)
Summary by CodeRabbit
신규 기능
/api/shops/{storeId}/images)가 추가되었습니다. 해당 엔드포인트를 통해 음식점에 등록된 이미지 URL 리스트를 확인할 수 있습니다.버그 수정
문서화
테스트