Skip to content
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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Combi153
Copy link
Contributor

@Combi153 Combi153 commented May 9, 2024

📌 관련 이슈

📁 작업 설명

  • 회원이 자신의 리뷰 내역을 조회할 수 있는 기능을 개발했습니다.

📸 작업화면

image

기타

기획적으로 명확하지 않은 부분은 기획자분께 문의해두었습니다. 확인되면 반영할게요!
image

@Combi153 Combi153 self-assigned this May 9, 2024
Copy link

github-actions bot commented May 9, 2024

Test Results

 64 files  ±0   64 suites  ±0   25s ⏱️ -1s
310 tests +4  307 ✅ +1  0 💤 ±0  3 ❌ +3 
430 runs  +4  427 ✅ +1  0 💤 ±0  3 ❌ +3 

For more details on these failures, see this check.

Results for commit 129d715. ± Comparison against base commit 35f447a.

Copy link
Contributor

@hgo641 hgo641 left a 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

Copy link
Contributor

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);

Copy link
Member

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(),
Copy link
Contributor

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>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ids를 받게 바꾸고 재활용 넘 좋네요!!

Copy link
Member

@TaeyeonRoyce TaeyeonRoyce left a 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")
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 조회 데이터에 대한 검증은 모든 필드를 할 필요는 없다고 생각합니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: 내 리뷰 내역 조회 api
3 participants