Commit 105c212c authored by limei's avatar limei

接口修改

parent b86676bd
......@@ -59,7 +59,7 @@ public interface CheckModelService extends IService<CheckModel> {
JSONArray getDataTree();
List<Object> getRule(String project);
List<JSONObject> getRule(String project);
List<Object> getCompanyName();
......
......@@ -106,7 +106,7 @@ public class CheckModelController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/getRule")
@ApiOperation(httpMethod = "GET", value = "关联规则", notes = "关联规则")
public ResponseModel<List<Object>> getRule(String project) {
public ResponseModel<List<JSONObject>> getRule(String project) {
return ResponseHelper.buildResponse(checkModelService.getRule(project));
}
......
......@@ -209,14 +209,21 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im
}
@Override
public List<Object> getRule(String project) {
public List<JSONObject> getRule(String project) {
List result = uruleFeignService.getRule(project).getResult();
List<Object> objectList = new ArrayList<>();
List<JSONObject> objectList = new ArrayList<>();
for(Object object: result){
JSONArray array = JSONObject.parseObject(JSON.toJSONString(object)).getJSONArray("resourceItems");
for(Object object1: array){
objectList.add(object1);
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(object1));
String modelRule = jsonObject.getString("path");
if(!ValidationUtil.isEmpty(modelRule)){
modelRule = modelRule.substring(modelRule.indexOf("/")+1,modelRule.indexOf("."));
}
jsonObject.put("path",modelRule);
objectList.add(jsonObject);
}
}
return objectList;
......@@ -269,9 +276,9 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im
}
}
String modelRule = jsonObject.getString("model_rule");
if(!ValidationUtil.isEmpty(modelRule)){
modelRule = modelRule.substring(modelRule.indexOf("/")+1,modelRule.indexOf("."));
}
// if(!ValidationUtil.isEmpty(modelRule)){
// modelRule = modelRule.substring(modelRule.indexOf("/")+1,modelRule.indexOf("."));
// }
JSONArray modelFile = jsonObject.getJSONArray("model_file");
String fileUrl = "";
Iterator iterator = modelFile.iterator();
......
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