From 1edf557f7b8000e777d48f79382aee4f400d038d Mon Sep 17 00:00:00 2001 From: LDY Date: Thu, 18 Jul 2024 17:37:44 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=AC=B8=EC=9E=90=EC=97=B4=20?= =?UTF-8?q?=EC=A1=B4=EC=9E=AC=20=EC=97=AC=EB=B6=80=20=ED=8C=90=EB=8B=A8=20?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=EB=9F=AC=EB=A6=AC=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/directory/repository/DirectoryRepositoryImpl.java | 4 ++-- .../goat/server/review/repository/ReviewRepositoryImpl.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/goat/server/directory/repository/DirectoryRepositoryImpl.java b/src/main/java/com/goat/server/directory/repository/DirectoryRepositoryImpl.java index 2d88fde..8a0866e 100644 --- a/src/main/java/com/goat/server/directory/repository/DirectoryRepositoryImpl.java +++ b/src/main/java/com/goat/server/directory/repository/DirectoryRepositoryImpl.java @@ -12,7 +12,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; -import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; @Repository @RequiredArgsConstructor @@ -37,7 +37,7 @@ public List findAllDirectoryResponseBySortAndSearch( //search가 null이면 parentDirectoryId로 검색, 아니면 search로 검색 - search 존재 -> 전체 검색 private BooleanExpression isSearchExpression(Long parentDirectoryId, String search) { - if (ObjectUtils.isEmpty(search)) { + if (StringUtils.hasLength(search)) { return parentDirectoryFindExpression(parentDirectoryId); } else { return directory.title.contains(search); diff --git a/src/main/java/com/goat/server/review/repository/ReviewRepositoryImpl.java b/src/main/java/com/goat/server/review/repository/ReviewRepositoryImpl.java index b12b616..afed6d5 100644 --- a/src/main/java/com/goat/server/review/repository/ReviewRepositoryImpl.java +++ b/src/main/java/com/goat/server/review/repository/ReviewRepositoryImpl.java @@ -12,7 +12,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; -import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; @Repository @RequiredArgsConstructor @@ -37,7 +37,7 @@ public List findAllReviewSimpleResponseBySortAndSearch( //search가 null이면 parentDirectoryId로 검색, 아니면 search로 검색 - search 존재 -> 전체 검색 private BooleanExpression searchExpression(Long parentDirectoryId, String search) { - if (ObjectUtils.isEmpty(search)) { + if (StringUtils.hasLength(search)) { return review.directory.id.eq(parentDirectoryId); } else { return review.title.contains(search);