Skip to content

Conversation

@kjhh2605
Copy link
Contributor

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호

📝작업 내용

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

스크린샷 (선택)

💬리뷰 요구사항(선택)

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

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

@kjhh2605 kjhh2605 linked an issue Aug 22, 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!

This pull request refactors the API search query by modifying the findByCursor method within the CardRepository. The primary purpose of this change is to enhance the accuracy and relevance of search results by applying stricter filtering. It ensures that the search functionality only returns Card entities that are not marked as deleted and are explicitly designated as shared, thereby improving data consistency for users.

Highlights

  • API Query Refinement: The findByCursor method in CardRepository has been updated to include additional filtering criteria.
  • Data Filtering: The query now explicitly excludes cards marked as isDeleted = true and includes only cards where 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은 전체 카드 조회 쿼리에 삭제 여부(isDeleted)와 공유 여부(isShared) 조건을 추가하여, 의도에 맞게 공유되고 삭제되지 않은 카드만 조회하도록 수정한 것으로 보입니다. 이는 데이터 정확성 측면에서 올바른 수정입니다.

리뷰에서는 두 가지 개선점을 제안했습니다. 첫째, 데이터가 증가함에 따라 발생할 수 있는 성능 저하를 방지하기 위해 (is_deleted, is_shared, id)에 대한 데이터베이스 복합 인덱스 추가를 권장했습니다. 둘째, 쿼리의 내용이 변경된 만큼, findByCursor라는 일반적인 메서드 이름을 findSharedCardsByCursor와 같이 더 명확한 이름으로 변경하여 코드의 가독성을 높이는 것을 제안했습니다.

Comment on lines 24 to 31
@Query("""
SELECT c FROM Card c
WHERE (:cursor IS NULL OR c.id > :cursor)
AND c.isDeleted = false
AND c.isShared = true
ORDER BY c.id ASC
""")
Slice<Card> findByCursor(@Param("cursor") Long cursor, Pageable pageable);

Choose a reason for hiding this comment

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

medium

쿼리에 isDeleted = falseisShared = true 조건을 추가하여 삭제되거나 공유되지 않은 카드만 필터링하도록 수정한 것은 데이터 정확성 측면에서 좋은 개선입니다.

다만, 몇 가지 개선점을 제안합니다:

  1. 성능 최적화: cards 테이블의 데이터가 많아질 경우 성능 저하가 발생할 수 있습니다. (is_deleted, is_shared, id) 컬럼에 대한 복합 인덱스를 추가하면 WHERE 절과 ORDER BY 절의 성능을 크게 향상시킬 수 있습니다. Card 엔티티의 @Table 어노테이션에 인덱스를 정의하는 것을 고려해 보세요.
  2. 메서드 이름 명확화: 쿼리의 역할이 더 명확해졌으므로, 메서드 이름도 이를 반영하도록 변경하는 것이 좋습니다. 예를 들어, findByCursor 대신 findSharedCardsByCursor와 같이 변경하면 코드의 가독성과 유지보수성이 향상될 것입니다.

@hamtorygoals hamtorygoals merged commit 80defca into main Aug 22, 2025
2 checks passed
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] 탐색 화면 소프트 딜리트 카드 제외

3 participants