From 0388dada372a2b539594eb3d761914ae452fc435 Mon Sep 17 00:00:00 2001 From: gahee99 Date: Sun, 9 Jun 2024 15:03:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B0=90=EC=9E=A1=EC=9D=80=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B4=EB=84=88=20api=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gam/api/domain/user/repository/UserRepository.java | 2 +- .../java/com/gam/api/domain/user/service/UserServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gam/api/domain/user/repository/UserRepository.java b/src/main/java/com/gam/api/domain/user/repository/UserRepository.java index fda913a3..7032368b 100644 --- a/src/main/java/com/gam/api/domain/user/repository/UserRepository.java +++ b/src/main/java/com/gam/api/domain/user/repository/UserRepository.java @@ -15,7 +15,7 @@ public interface UserRepository extends JpaRepository { Optional getUserById(Long userId); boolean existsByUserName(String userName); - List findByUserStatusOrderByScrapCountDesc(UserStatus userStatus); // TODO - 기획 + List findByUserStatusAndFirstWorkIdIsNotNullOrderByScrapCountDesc(UserStatus userStatus); @Query(value = "SELECT u FROM User u WHERE LOWER(u.userName) LIKE %:keyword% ORDER BY u.createdAt DESC") List findByUserName(@Param("keyword") String keyword); diff --git a/src/main/java/com/gam/api/domain/user/service/UserServiceImpl.java b/src/main/java/com/gam/api/domain/user/service/UserServiceImpl.java index e4735114..faf3c806 100644 --- a/src/main/java/com/gam/api/domain/user/service/UserServiceImpl.java +++ b/src/main/java/com/gam/api/domain/user/service/UserServiceImpl.java @@ -237,7 +237,7 @@ public UserProfileResponseDTO getUserProfile(Long myId, Long userId) { @Override public List getPopularDesigners(Long userId) { //TODO - 쿼리 지연 - val users = userRepository.findByUserStatusOrderByScrapCountDesc(UserStatus.PERMITTED); + val users = userRepository.findByUserStatusAndFirstWorkIdIsNotNullOrderByScrapCountDesc(UserStatus.PERMITTED); val me = findUser(userId); removeBlockUsers(users, me);