-
Notifications
You must be signed in to change notification settings - Fork 2
Refactor: 팔로워 목록 로직 수정, query 없는 경우 추가 #183
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
Conversation
There was a problem hiding this 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!
이 풀 리퀘스트는 팔로워 및 팔로잉 목록 조회 기능을 개선하여 사용자가 검색어를 입력하지 않아도 초기 목록을 볼 수 있도록 합니다. 기존에는 검색어가 필수였으나, 이제 query 파라미터를 선택 사항으로 변경하고, 관련 백엔드 로직(컨트롤러, 서비스, 리포지토리)을 업데이트하여 null 쿼리 값을 올바르게 처리하도록 리팩토링했습니다. 이는 사용자 경험을 향상시키고, 목록 화면 진입 시 즉각적인 정보 제공을 가능하게 합니다.
Highlights
- 검색어(query) 선택 사항화: 팔로워/팔로잉 목록 조회 시 검색어(query)를 필수로 입력하지 않아도 되도록 변경했습니다. 이제 검색어 없이도 기본 목록을 볼 수 있습니다.
- Null 쿼리 처리 로직 추가: 컨트롤러와 서비스 계층에서
query파라미터가null을 허용하도록 수정되었으며, Repository 계층의 JPQL 쿼리도query가null일 경우를 처리하도록 업데이트되었습니다. - Repository 메서드 리팩토링: 팔로워 목록 조회를 위한 새로운 Repository 메서드인
searchAccountInFollower가 추가되었고, 기존의searchAccountNotInFollow메서드는 삭제되었습니다.
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
-
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. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
이번 PR은 팔로워/팔로잉 목록 조회 시 검색어(query)가 없는 경우를 처리하고 관련 로직을 리팩토링하는 변경사항을 담고 있습니다. 전반적으로 PR의 의도는 좋으나, JPQL 쿼리에서 AND와 OR 연산자 우선순위 문제로 인해 발생할 수 있는 심각한 논리적 오류가 발견되었습니다. 또한, 서비스 레이어에 불필요한 코드가 포함되어 있어 제거가 필요합니다. 아래의 리뷰 코멘트에서 자세한 내용을 확인하고 수정해 주시기 바랍니다.
| AND (:query IS NULL OR | ||
| LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | ||
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JPQL 쿼리에서 AND와 OR 연산자의 우선순위 문제로 인해 논리적 오류가 발생할 수 있습니다. 현재 쿼리는 ... AND (:query IS NULL) OR (LOWER(u.nameId) ...) 와 같이 해석될 수 있어, query가 null이 아닐 경우 loginUserId 조건이 무시될 수 있습니다. OR 조건들을 괄호로 묶어 의도한 대로 동작하도록 수정해야 합니다.
| AND (:query IS NULL OR | |
| LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | |
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%'))) | |
| AND (:query IS NULL OR (LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | |
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%')))) |
| AND (:query IS NULL OR | ||
| LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | ||
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searchAccountInFollow 쿼리와 마찬가지로, 이 쿼리에서도 AND와 OR 연산자 우선순위로 인한 논리적 오류가 존재합니다. OR 조건들을 괄호로 묶어주세요.
| AND (:query IS NULL OR | |
| LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | |
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%'))) | |
| AND (:query IS NULL OR | |
| (LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%')) | |
| OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%')))) |
| if(query == null){ | ||
|
|
||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2anizirong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳
#️⃣연관된 이슈
📝작업 내용
스크린샷 (선택)
💬리뷰 요구사항(선택)