-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] '스토리 상세 조회 API'에 storeId 값 추가 #129
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
- 해당 store 가 있을 경우, storeId 값을 같이 반환 - 해당 store 가 없을 경우, storeId 를 null 로 반환
Walkthrough스토리 상세 조회 응답에 새로운 필드 Changes
Sequence Diagram(s)sequenceDiagram
participant Controller
participant StoryService
participant StoryRepository
participant StoreRepository
Controller->>StoryService: getStory(storyId)
StoryService->>StoryRepository: findById(storyId)
StoryRepository-->>StoryService: Story
StoryService->>StoreRepository: findByKakaoId(story.storeKakaoId)
StoreRepository-->>StoryService: Store | null
StoryService->>Controller: StoryResponse(storeId, ...)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ 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 (2)
src/test/java/eatda/document/story/StoryDocumentTest.java (1)
167-167: storeId 필드 문서화가 올바르게 추가됨새로운 storeId 필드가 NUMBER 타입, nullable, optional로 적절히 문서화되었습니다. 다만 설명이 "가게의 카카오 ID"로 되어 있는데, 실제로는 내부 store ID를 의미하므로 설명 수정이 필요합니다.
- fieldWithPath("storeId").type(NUMBER).description("가게의 카카오 ID (nullable)").optional(), + fieldWithPath("storeId").type(NUMBER).description("가게의 내부 ID (nullable)").optional(),src/test/java/eatda/service/story/StoryServiceTest.java (1)
179-179: 불필요한 세미콜론 제거 필요Line 179에 불필요한 세미콜론이 있습니다.
- ); - ; + );
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/main/java/eatda/controller/story/StoryResponse.java(2 hunks)src/main/java/eatda/service/story/StoryService.java(3 hunks)src/test/java/eatda/controller/story/StoryControllerTest.java(2 hunks)src/test/java/eatda/document/story/StoryDocumentTest.java(2 hunks)src/test/java/eatda/service/story/StoryServiceTest.java(4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: in story.java, the validatestoreroadaddress method only checks for null (not blank) because the kaka...
Learnt from: leegwichan
PR: YAPP-Github/26th-Web-Team-1-BE#101
File: src/main/java/eatda/domain/story/Story.java:126-130
Timestamp: 2025-07-23T11:19:46.968Z
Learning: In Story.java, the validateStoreRoadAddress method only checks for null (not blank) because the Kakao API can legitimately return empty strings for roadAddress values in certain cases, so blank road addresses should be allowed.
Applied to files:
src/main/java/eatda/controller/story/StoryResponse.javasrc/main/java/eatda/service/story/StoryService.javasrc/test/java/eatda/service/story/StoryServiceTest.javasrc/test/java/eatda/controller/story/StoryControllerTest.javasrc/test/java/eatda/document/story/StoryDocumentTest.java
🔇 Additional comments (13)
src/test/java/eatda/controller/story/StoryControllerTest.java (2)
92-103: 테스트 모의 객체가 새로운 storeId 필드를 올바르게 반영함StoryResponse 생성자에 storeId(5L)가 첫 번째 파라미터로 올바르게 추가되었습니다.
114-114: storeId 필드에 대한 assertion이 적절히 추가됨새로 추가된 storeId 필드에 대한 검증이 올바르게 구현되었습니다.
src/main/java/eatda/controller/story/StoryResponse.java (2)
3-3: @nullable 어노테이션 import가 적절히 추가됨새로운 nullable storeId 필드를 위한 어노테이션 import가 올바르게 추가되었습니다.
6-6: storeId 필드가 올바르게 추가됨@nullable Long storeId 필드가 첫 번째 파라미터로 적절히 추가되었으며, nullable 어노테이션도 올바르게 적용되었습니다.
src/main/java/eatda/service/story/StoryService.java (3)
14-14: Store 관련 의존성이 적절히 추가됨Store 도메인과 StoreRepository 의존성이 올바르게 추가되었습니다.
Also applies to: 19-19, 40-40
99-101: storeId 조회 로직이 올바르게 구현됨스토리의 storeKakaoId로 Store 엔티티를 조회하여 존재하면 id를, 없으면 null을 반환하는 로직이 적절히 구현되었습니다.
104-104: StoryResponse 생성자에 storeId가 올바르게 전달됨새로 조회한 storeId가 StoryResponse의 첫 번째 파라미터로 올바르게 전달되었습니다.
src/test/java/eatda/document/story/StoryDocumentTest.java (3)
8-9: JsonFieldType import가 적절히 추가됨응답 필드의 타입을 명시적으로 지정하기 위한 import가 올바르게 추가되었습니다.
168-176: 기존 필드들의 타입이 명시적으로 지정됨기존 응답 필드들에 JsonFieldType이 적절히 추가되어 문서화가 더욱 명확해졌습니다.
182-183: 테스트 케이스가 nullable storeId를 올바르게 반영함StoryResponse 생성자에 null 값을 첫 번째 인자로 전달하여 storeId의 nullable 특성을 적절히 테스트하고 있습니다.
src/test/java/eatda/service/story/StoryServiceTest.java (3)
5-5: 필요한 import가 적절히 추가됨assertAll과 Store import가 올바르게 추가되었습니다.
Also applies to: 16-16
112-144: 스토어ID가 없는 경우의 테스트가 올바르게 수정됨메서드명이 더 명확해지고, storeId가 null인지 검증하는 로직이 적절히 추가되었습니다. assertAll을 사용하여 모든 필드를 체계적으로 검증하고 있습니다.
146-179: 스토어ID가 있는 경우의 테스트가 적절히 추가됨storeGenerator를 사용하여 Store 엔티티를 생성하고, 해당 Store와 연결된 Story가 올바른 storeId를 반환하는지 검증하는 테스트가 잘 구현되었습니다.
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도 고생하셨습니다! 🦖
코드 자동 정렬 한번 돌릴까요...?
| void 스토리_상세_조회_성공() { | ||
| long storyId = 1L; | ||
| StoryResponse response = new StoryResponse( | ||
| StoryResponse response =new StoryResponse( |
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.
앗 =new StoryResponse( -> = new StoryResponse( 이라면...?
|
|
🎉 This PR is included in version 1.4.0-develop.40 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



✨ 개요
🧾 관련 이슈
🔍 참고 사항 (선택)
Summary by CodeRabbit
신규 기능
문서화
테스트