Commit ed030a62 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer
parents fe5a804a c4c319d6
package com.gic.cloud.operation.web.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.authcenter.security.core.util.UserUtils;
......@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
......@@ -101,10 +103,19 @@ public class DataExplainController {
}
@RequestMapping("/data-module-list")
public RestResponse moduleList() {
public RestResponse moduleList(String moduleId) {
Object cache = RedisUtil.getCache("enterprise:datacloud:moduleList");
if (cache != null) {
return RestResponse.success(JSON.parseArray(cache.toString()));
List<JSONObject> resultList = JSON.parseArray(cache.toString(), JSONObject.class);
Page<DataExplainDTO> page = dataExplainApiService.listDataExplain(new DataExplainQo()).getResult();
if (page != null) {
List<DataExplainDTO> result = page.getResult();
Set<String> usedList = result.stream().filter(e -> StringUtils.isNotBlank(e.getModuleId())).map(DataExplainDTO::getModuleId).collect(Collectors.toSet());
resultList = resultList.stream().filter(e -> !usedList.contains(e.getString("moduleId")) || StringUtils.equals(e.getString("moduleId"), moduleId)).collect(Collectors.toList());
}
return RestResponse.success(resultList);
}
return RestResponse.success();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment