-
Notifications
You must be signed in to change notification settings - Fork 0
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
feature: 내 리뷰 내역 조회 api #132
base: develop
Are you sure you want to change the base?
The head ref may contain hidden characters: "129-feature-\uB0B4-\uB9AC\uBDF0-\uB0B4\uC5ED-\uC870\uD68C-api"
Conversation
Test Results 64 files ±0 64 suites ±0 25s ⏱️ -1s For more details on these failures, see this check. Results for commit 129d715. ± Comparison against base commit 35f447a. |
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.
코드가 깔끔해서 읽기 쉬웠어요!! 👍
고생하셨습니다!
val memberProductReviews = memberProductReviewsResponse.memberProductReviews | ||
|
||
memberProductReviews.size shouldBe 2 | ||
|
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.
여기 아래 memberProductReviews검증하는 코드가 조큼 긴데
음... 메서드로 분리하면 어떨까요??
valdiateMemberProductReview(memberProductReviewB, productReivewB, orderB);
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.
- 조회 데이터에 대한 검증은 모든 필드를 할 필요는 없다고 생각합니다!
).whereAnd( | ||
productReviewIdLt(paging.lastViewedId), | ||
).orderBy( | ||
path(ProductReview::createdAt).desc(), |
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.
createdAt 대신 id로 정렬해도 무방한 거 맞을까요??
id가 인덱스라 더 효율적일 것 같아서요!
@@ -59,12 +62,22 @@ class ProductReviewService( | |||
return ProductReviewsResponse.of(responses, query.limit) | |||
} | |||
|
|||
private fun getImagesByReview(reviewsByCondition: List<ProductReviewWithMemberResponse>): Map<Long, List<String>> { | |||
val productReviewIds = reviewsByCondition.map { it.id } | |||
private fun getImagesByReviewIds(productReviewIds: List<Long>): Map<Long, List<String>> { |
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.
ids를 받게 바꾸고 재활용 넘 좋네요!!
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.
고생하셨습니다!
코드 깔끔하네요👍👍
테스트만 통과하게 수정하면 될 것 같습니다!
@Operation(summary = "내 후기 조회 API", description = "내가 작성한 상품의 후기를 조회합니다") | ||
@ApiResponse(responseCode = "200", description = "상품 후기 조건 조회 성공") | ||
@SecurityRequirement(name = ACCESS_TOKEN_SECURITY_SCHEME_KEY) | ||
@GetMapping("/product-reviews/me") |
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.
URI 좋네용👍
val memberProductReviews = memberProductReviewsResponse.memberProductReviews | ||
|
||
memberProductReviews.size shouldBe 2 | ||
|
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.
- 조회 데이터에 대한 검증은 모든 필드를 할 필요는 없다고 생각합니다!
📌 관련 이슈
📁 작업 설명
📸 작업화면
기타
기획적으로 명확하지 않은 부분은 기획자분께 문의해두었습니다. 확인되면 반영할게요!