Skip to content

Conversation

@kjhh2605
Copy link
Contributor

#️⃣연관된 이슈

182

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)
목록 조회 화면 처음에 들어갔을 때 검색하기 전에도 목록이 떠야 하므로 query를 null 허용 했고 이에 따른 repository메소드 @query
부분도 수정했습니다

스크린샷 (선택)

image

💬리뷰 요구사항(선택)

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

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!

이 풀 리퀘스트는 팔로워 및 팔로잉 목록 조회 기능을 개선하여 사용자가 검색어를 입력하지 않아도 초기 목록을 볼 수 있도록 합니다. 기존에는 검색어가 필수였으나, 이제 query 파라미터를 선택 사항으로 변경하고, 관련 백엔드 로직(컨트롤러, 서비스, 리포지토리)을 업데이트하여 null 쿼리 값을 올바르게 처리하도록 리팩토링했습니다. 이는 사용자 경험을 향상시키고, 목록 화면 진입 시 즉각적인 정보 제공을 가능하게 합니다.

Highlights

  • 검색어(query) 선택 사항화: 팔로워/팔로잉 목록 조회 시 검색어(query)를 필수로 입력하지 않아도 되도록 변경했습니다. 이제 검색어 없이도 기본 목록을 볼 수 있습니다.
  • Null 쿼리 처리 로직 추가: 컨트롤러와 서비스 계층에서 query 파라미터가 null을 허용하도록 수정되었으며, Repository 계층의 JPQL 쿼리도 querynull일 경우를 처리하도록 업데이트되었습니다.
  • 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

  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은 팔로워/팔로잉 목록 조회 시 검색어(query)가 없는 경우를 처리하고 관련 로직을 리팩토링하는 변경사항을 담고 있습니다. 전반적으로 PR의 의도는 좋으나, JPQL 쿼리에서 AND와 OR 연산자 우선순위 문제로 인해 발생할 수 있는 심각한 논리적 오류가 발견되었습니다. 또한, 서비스 레이어에 불필요한 코드가 포함되어 있어 제거가 필요합니다. 아래의 리뷰 코멘트에서 자세한 내용을 확인하고 수정해 주시기 바랍니다.

Comment on lines 42 to 44
AND (:query IS NULL OR
LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%'))
OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%')))

Choose a reason for hiding this comment

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

critical

JPQL 쿼리에서 ANDOR 연산자의 우선순위 문제로 인해 논리적 오류가 발생할 수 있습니다. 현재 쿼리는 ... AND (:query IS NULL) OR (LOWER(u.nameId) ...) 와 같이 해석될 수 있어, query가 null이 아닐 경우 loginUserId 조건이 무시될 수 있습니다. OR 조건들을 괄호로 묶어 의도한 대로 동작하도록 수정해야 합니다.

Suggested change
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, '%'))))

Comment on lines 58 to 60
AND (:query IS NULL OR
LOWER(u.nameId) LIKE LOWER(CONCAT(:query, '%'))
OR LOWER(u.nickname) LIKE LOWER(CONCAT(:query, '%')))

Choose a reason for hiding this comment

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

critical

searchAccountInFollow 쿼리와 마찬가지로, 이 쿼리에서도 ANDOR 연산자 우선순위로 인한 논리적 오류가 존재합니다. OR 조건들을 괄호로 묶어주세요.

Suggested change
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, '%'))))

Comment on lines 214 to 217
if(query == null){

}

Choose a reason for hiding this comment

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

high

if(query == null) 블록은 비어 있어 아무런 동작도 하지 않습니다. 불필요한 코드이므로 제거하는 것이 좋습니다.

Copy link
Member

@2anizirong 2anizirong left a comment

Choose a reason for hiding this comment

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

@2anizirong 2anizirong merged commit 1666b25 into main Aug 20, 2025
2 checks passed
@2anizirong 2anizirong deleted the refactor/182-follow-list 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] 팔로우 목록 조회 api 수정

3 participants