Skip to content

Conversation

@kjhh2605
Copy link
Contributor

#️⃣연관된 이슈

184

📝작업 내용

isShared = true 추가

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

스크린샷 (선택)

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

@kjhh2605 kjhh2605 linked an issue Aug 20, 2025 that may be closed by this pull request
3 tasks
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.

Summary of Changes

Hello @kjhh2605, 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은 findCardsWithReactionCountOver1 쿼리를 수정하여, 카드 조회 시 isShared 속성이 true인 카드만 결과에 포함되도록 개선합니다. 이는 사용자가 공유된 카드만 볼 수 있도록 하여 데이터의 정확성과 사용자 경험을 향상시키는 데 목적이 있습니다.

Highlights

  • 쿼리 수정: CardRepository.java 파일의 findCardsWithReactionCountOver1 JPQL 쿼리에 c.isShared = true 조건을 추가하여 공유된 카드만 조회되도록 변경했습니다.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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은 추천 카드 조회 쿼리에 isShared = true 조건을 추가하여 공유된 카드만 조회하도록 수정합니다. 변경 사항은 올바르며, 공유되지 않은 카드가 추천 목록에 나타나는 것을 방지합니다.

한 가지 개선 제안으로, 반응(reaction) 최소 개수를 하드코딩하는 대신 JPQL 파라미터로 전달하도록 리팩토링하는 것을 권장합니다. 이렇게 하면 향후 최소 개수 변경 시(예: 주석에 언급된 100개) 메서드 호출부에서 값을 조정하는 것만으로 유연하게 대응할 수 있습니다.

WHERE c.isDeleted = false
AND c.isShared = true
GROUP BY c
HAVING COUNT(r) >= 1

Choose a reason for hiding this comment

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

medium

하드코딩된 1 대신 파라미터를 사용하여 유연성을 높이는 것이 좋습니다. 코드 주석(//초기 테스트로 1개로 수정 (기존은 100개))을 보면 이 값은 향후 변경될 가능성이 있습니다. 값을 파라미터화하면 쿼리 자체를 수정하지 않고도 이 임계값을 쉽게 조정할 수 있습니다.

이 변경을 적용하려면 메서드 시그니처도 함께 업데이트해야 합니다:

List<Card> findCardsWithMinReactionCount(@Param("minReactionCount") long minReactionCount);

또한, 메서드 이름을 좀 더 일반적인 이름으로 변경하는 것을 고려해볼 수 있습니다.

Suggested change
HAVING COUNT(r) >= 1
HAVING COUNT(r) >= :minReactionCount

@2anizirong 2anizirong merged commit fc4afda into main Aug 20, 2025
2 checks passed
@2anizirong 2anizirong deleted the refactor/184-card-repository-query branch August 20, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] CardRepository 카드 조회 쿼리문 수정

3 participants