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);