Commit cd836a67 authored by wdy's avatar wdy

科恩获取树状测试用例、获取标准要求

parent e746da10
...@@ -306,12 +306,17 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU ...@@ -306,12 +306,17 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
String string = response.body().string(); String string = response.body().string();
JSONObject jsonObject = JSONObject.parseObject(string); JSONObject jsonObject = JSONObject.parseObject(string);
// 获取测试用例 // 获取测试用例
List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class); if (jsonObject.getJSONObject("data").getJSONObject("regulationByName") != null) {
List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class);
userCaseResponse.setUseCases(list);
// 获取总条数 userCaseResponse.setUseCases(list);
Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount"); // 获取总条数
userCaseResponse.setTotalCount(totalCount); Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount");
userCaseResponse.setTotalCount(totalCount);
} else {
userCaseResponse.setUseCases(new ArrayList<>());
userCaseResponse.setTotalCount(0);
}
return userCaseResponse; return userCaseResponse;
} }
...@@ -342,13 +347,18 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU ...@@ -342,13 +347,18 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
Response response = client.newCall(requestKE).execute(); Response response = client.newCall(requestKE).execute();
String string = response.body().string(); String string = response.body().string();
JSONObject jsonObject = JSONObject.parseObject(string); JSONObject jsonObject = JSONObject.parseObject(string);
// 获取测试用例 // 获取测试标准
List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class); if (jsonObject.getJSONObject("data").getJSONObject("regulationByName") != null) {
List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class);
standardListResponse.setStandards(list);
// 获取总条数 standardListResponse.setStandards(list);
Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount"); // 获取总条数
standardListResponse.setTotalCount(totalCount); Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount");
standardListResponse.setTotalCount(totalCount);
} else {
standardListResponse.setStandards(new ArrayList<>());
standardListResponse.setTotalCount(0);
}
return standardListResponse; return standardListResponse;
} }
......
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