Skip to content

Commit

Permalink
bugfix: IP选择器静态拓扑搜索条件前加上空格后筛选失效 TencentBlueKing#1737
Browse files Browse the repository at this point in the history
去除切分出的空字符串作为搜索条件
  • Loading branch information
jsonwan committed Feb 10, 2023
1 parent 85f8c01 commit 60c8103
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
* 资源范围下的主机服务
Expand Down Expand Up @@ -235,7 +237,9 @@ private BasicParsedSearchConditions buildSearchConditions(AppResourceScope appRe

List<String> searchContents = null;
if (searchContent != null) {
searchContents = StringUtil.splitByNormalSeparator(searchContent);
searchContents = StringUtil.splitByNormalSeparator(searchContent.trim()).stream()
.filter(StringUtils::isNotBlank)
.collect(Collectors.toList());
}

//获取所有云区域,找出名称符合条件的所有CloudAreaId
Expand Down

0 comments on commit 60c8103

Please sign in to comment.