Merged
Conversation
- 디미터 법칙 적용 - 묻지 말고 시켜라 - 중복 리뷰 좋아요 개선 - 리뷰 좋아요 테스트 코드 작성 - 리뷰 확인 테스트 코드 작성 🔗 Resolves: #315
soyun-i
reviewed
Apr 19, 2025
| REVIEW_DUPLICATE(HttpStatus.CONFLICT, "이미 리뷰를 작성했습니다."), | ||
| RATING_OUT_OF_RANGE(HttpStatus.BAD_REQUEST, "별점은 1~5점을 해야한다."), | ||
| REVIEW_NOT_FOUND(HttpStatus.BAD_REQUEST, "작성하신 리뷰가 없습니다."), | ||
| ALLREADY_LIVIEW_LIKED(HttpStatus.CONFLICT, "이미 리뷰 좋아요를 했습니다."), |
| } | ||
|
|
||
| public String getProductSummary() { | ||
| return saleProduct.getProductSummary(quantity); |
Contributor
There was a problem hiding this comment.
리뷰 작성을 할때 필요한 상품 정보를 가져오는 메서드인가요? quantity를 보내는 이유가 궁금합니다!
Contributor
Author
There was a problem hiding this comment.
리뷰 작성할때 상품 요약으로 상품명/수량/옵션을 나타내는 것입니다.
리뷰를 가져올때 불필요한 조인으로 옵션과 수량 상품명을 갖고 오지 않으려고 만들어 놨습니다.
주문에서 quantity를 판매 상품에 보내는 이유는 saleproduct에 있는 데이터와 수량을 갖고 productsummary를 반환해 줍니다.
기존에 이 로직이 리뷰 서비스에서 해주었습니다. 지금 구조로 가져간다면 상품 요약이 변경 되었을때
사이 임팩트로 서비스까지 변경이 될 부분이 사라질 수 있어서 이렇게 만들어 보았습니다.
- 오타 수정 🔗 Resolves: #315
soyun-i
approved these changes
Apr 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Resolves: #315
🚀 어떤 기능을 구현했나요 ?
🔥 어떤 문제를 마주했나요 ?
기존 productsummary 생성 부분에서 service에서 option null 인지 판별하는 역할을 넘는 행위를 하고 있었다.
entity와 같은 값은 어쩔 수 없이 값을 알기 위해 get.get.을 해야 하지만 if 문으로 service에서 처리하는 것은
프론트에서 보여줄 값이 늘어나면 불필요한 service에 변경이 가해지므로 책임을 orderDetail과 saleProduct에 전가했다.
✨ 어떻게 해결했나요 ?
📝 어떤 부분에 집중해서 리뷰해야 할까요?
📚 참고 자료 및 회고