Commit cd836a67 authored by wdy's avatar wdy

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

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