Skip to content

Commit

Permalink
Merge pull request #41 from GOAT-WAAAM/refactor/ldy/string-util
Browse files Browse the repository at this point in the history
[REFACTOR] 문자열 존재 여부 판단 라이브러리 변경
  • Loading branch information
leedy3838 authored Jul 18, 2024
2 parents bee426c + 1edf557 commit 7b4aaa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,7 +37,7 @@ public List<DirectoryResponse> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,7 +37,7 @@ public List<ReviewSimpleResponse> 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);
Expand Down

0 comments on commit 7b4aaa7

Please sign in to comment.