This commit is contained in:
赵禹光 2019-08-01 20:56:52 +08:00
parent 408b36307d
commit 6a9b414315
2 changed files with 7 additions and 1 deletions

View File

@ -162,4 +162,6 @@ public class Constants {
public static final String NULL_STRING = "null"; public static final String NULL_STRING = "null";
public static final String NUMBER_PATTERN = "^\\d+$"; public static final String NUMBER_PATTERN = "^\\d+$";
public static final String ANY_PATTERN = ".*";
} }

View File

@ -684,7 +684,11 @@ public class ServiceManager implements RecordListener<Service> {
} }
if (StringUtils.isNotBlank(serviceName)) { if (StringUtils.isNotBlank(serviceName)) {
matchList = searchServices(namespaceId, ".*" + serviceName + ".*"); StringJoiner regex = new StringJoiner(Constants.SERVICE_INFO_SPLITER);
for (String param : serviceName.split(Constants.SERVICE_INFO_SPLITER)) {
regex.add(StringUtils.isBlank(param) ? Constants.ANY_PATTERN : Constants.ANY_PATTERN + param + Constants.ANY_PATTERN);
}
matchList = searchServices(namespaceId, regex.toString());
} else { } else {
matchList = new ArrayList<>(chooseServiceMap(namespaceId).values()); matchList = new ArrayList<>(chooseServiceMap(namespaceId).values());
} }