Skip to content

Conversation

@JjungminLee
Copy link
Collaborator

@JjungminLee JjungminLee commented Nov 22, 2025

#️⃣ Issue Number

📝 요약(Summary)

  • ReviewCalculator Service를 활용하여 reviewCount, startCount가 맞지 않는 문제를 수정했습니다.

💬 공유사항 to 리뷰어

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

@JjungminLee JjungminLee self-assigned this Nov 22, 2025
@JjungminLee JjungminLee added the fix 고치기 label Nov 22, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @JjungminLee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 리뷰 수와 별점 통계가 실제 데이터와 일치하지 않던 버그를 수정합니다. ReviewServiceV2 내에서 이러한 통계를 계산하는 로직을 전용 RatingCalculator 컴포넌트를 활용하도록 리팩토링하여, 식사에 대한 리뷰 통계가 정확하게 집계되도록 개선했습니다.

Highlights

  • 리뷰 수 및 별점 불일치 문제 수정: 기존에 잘못 계산되던 리뷰 수(reviewCount)와 별점 통계(starCount 또는 rating) 문제를 해결했습니다.
  • RatingCalculator 도입: ReviewServiceV2에서 리뷰 통계 계산을 위해 RatingCalculator를 주입하여 사용하도록 변경했습니다. 이를 통해 통계 계산 로직이 중앙 집중화되고 정확성이 향상되었습니다.
  • findMealReviews 로직 개선: 식사에 대한 리뷰를 조회하는 findMealReviews 메서드에서 totalReviewCount, reviewRatingCount, rating 값을 RatingCalculator를 통해 정확하게 계산하도록 수정했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


버그는 숨어 계산은 다시 정확히 별점 빛나리

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

안녕하세요. PR을 잘 살펴보았습니다. ReviewCalculator를 도입하여 리뷰 및 평점 계산 로직을 중앙화하고, 데이터 불일치 문제를 해결한 점이 인상적입니다. 이는 코드의 응집도를 높이고 유지보수성을 향상시키는 좋은 리팩토링입니다.

다만, 버그 수정과 관련된 중요한 로직 변경임에도 불구하고 테스트 코드가 추가되지 않은 점이 아쉽습니다. RatingCalculator의 정확성을 검증하고 향후 회귀를 방지하기 위해 테스트 케이스를 보강해주시면 코드의 안정성이 더욱 높아질 것입니다. 이는 high 수준의 개선 사항으로 보입니다.

이 외에 몇 가지 코드 개선 제안을 코멘트로 남겼으니 참고 부탁드립니다.

private final ApplicationEventPublisher eventPublisher;

private final RatingCalculator ratingCalculator;
private final MealRatingService mealRatingService;

Choose a reason for hiding this comment

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

medium

findMealReviews 메서드에서 mealRatingService의 사용이 제거된 것으로 보입니다. 만약 ReviewServiceV2 클래스 내 다른 곳에서도 사용되지 않는다면, 의존성을 제거하여 코드를 더 깔끔하게 유지하는 것이 좋겠습니다.

Comment on lines +340 to 342
Integer likeCount = Optional.of(menus)
.orElse(Collections.emptyList())
.stream()

Choose a reason for hiding this comment

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

medium

meal.getMenus()null을 반환하지 않고 항상 List 인스턴스를 반환하므로, Optional로 감쌀 필요가 없습니다. 아래와 같이 코드를 간소화하는 것을 제안합니다.

Suggested change
Integer likeCount = Optional.of(menus)
.orElse(Collections.emptyList())
.stream()
Integer likeCount = menus.stream()

@JjungminLee JjungminLee merged commit d6bafe7 into develop Nov 22, 2025
@JjungminLee JjungminLee deleted the fix/#309 branch November 22, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 고치기

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants