Browse Source

!29 字典返回添加过滤条件,处理类型为空的算法

Merge pull request !29 from weijw/feature/algorithm-weijw
pull/12/head
ThinkEnergy Gitee 4 years ago
parent
commit
a2cd76695f
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      dubhe-server/admin/src/main/java/org/dubhe/admin/service/impl/DictServiceImpl.java

+ 2
- 2
dubhe-server/admin/src/main/java/org/dubhe/admin/service/impl/DictServiceImpl.java View File

@@ -111,9 +111,9 @@ public class DictServiceImpl implements DictService {
public DictDTO findByName(String name, String filter) {
Dict dict = dictMapper.selectCollByName(name);
if (!StringUtils.isEmpty(filter) && !ObjectUtils.isEmpty(dict) && !CollectionUtils.isEmpty(dict.getDictDetails())) {
// algorithmUsage:异常检测
// algorithmUsage:异常检测 目前只有algorithmUsage一种类型,所以不需要判断取哪个配置,方便以后扩展
String[] split = filter.split(":");
String s = split[1];
String s = split.length > 1 ? split[1] : "";
List<String> algorithmLimit = configAlgorithmLimit(s);
List<DictDetail> collect = dict.getDictDetails().stream().filter(item -> CollectionUtils.isEmpty(algorithmLimit) || algorithmLimit.contains(item.getValue())).collect(Collectors.toList());
dict.setDictDetails(collect);


Loading…
Cancel
Save