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

향수 통계 정보 조회 API #321

Merged
merged 2 commits into from
Dec 23, 2023
Merged

향수 통계 정보 조회 API #321

merged 2 commits into from
Dec 23, 2023

Conversation

dygma0
Copy link
Contributor

@dygma0 dygma0 commented Dec 23, 2023

What is this PR? 👀

Changes ✏️

  • 향수 리뷰가 존재하지 않을 경우 NullPointException 발생 문제 해결
  • 불필요한 join 제거

Test checklist 🧪

  • 빈 향수 리뷰 통계 조회
  • 향수 리뷰 통계 퍼센트 조회
  • 향수 리뷰 통계 데이터 조회

@dygma0 dygma0 added the 30분 후 merge! 다음 작업과 연관이 있어 30분 후 리뷰가 없을 경우 merge하는 PR입니다. label Dec 23, 2023
@dygma0 dygma0 self-assigned this Dec 23, 2023
Refactoring of the review statistics reporting has been done to consider only non-deleted reviews. Also, the input parameter type for methods getReviewFeatureCount and findByPerfumeId have been changed to primitive long. Made corresponding changes in the test cases too. Added an EMPTY constant to ReviewFeatureCount.
A new test class, ReviewServiceTest, has been added to the codebase to ensure correct integration and functionality of the review statistics feature. This class includes two main tests: assessing returned statistics when no reviews exist and validating statistics returned for existing reviews. This test will help to maintain the consistency of the Review service, especially during future updates and refactoring.
@dygma0 dygma0 merged commit 10caf50 into develop Dec 23, 2023
1 check passed
@dygma0 dygma0 deleted the task/RDPF-319 branch December 23, 2023 13:23
Copy link
Contributor

@oliviarla oliviarla left a comment

Choose a reason for hiding this comment

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

리뷰는 늦었지만.. LGTM !!👍🏻

.leftJoin(userEntity)
.on(reviewEntity.userId.eq(userEntity.id))
.fetchJoin()
.on(reviewEntity.userId.eq(userEntity.id), userEntity.deletedAt.isNull())
Copy link
Contributor

Choose a reason for hiding this comment

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

fetchJoin 빼도 괜찮은거였나요?! 😮
on절에 조건도 명시할 수 있었군요..!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
30분 후 merge! 다음 작업과 연관이 있어 30분 후 리뷰가 없을 경우 merge하는 PR입니다. PLZ-REVIEW-ME 🥹
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants