Commit 61f3a4f6 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'master'

科恩获取树状测试用例数量

See merge request !7
parents dc74ac4e a15f4dd8
...@@ -308,7 +308,13 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU ...@@ -308,7 +308,13 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
// 获取测试用例 // 获取测试用例
if (jsonObject.getJSONObject("data").getJSONObject("regulationByName") != null) { if (jsonObject.getJSONObject("data").getJSONObject("regulationByName") != null) {
List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class); List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class);
Integer useCaseNum = 0;
for(StandardNewVO vo : list) {
if (!vo.getUseCases().isEmpty()) {
useCaseNum += vo.getUseCases().size();
}
}
userCaseResponse.setUseCaseNum(useCaseNum);
userCaseResponse.setUseCases(list); userCaseResponse.setUseCases(list);
// 获取总条数 // 获取总条数
Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount"); Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount");
......
...@@ -17,4 +17,7 @@ public class TestUserCaseListNewResponse { ...@@ -17,4 +17,7 @@ public class TestUserCaseListNewResponse {
@ApiModelProperty("总条数") @ApiModelProperty("总条数")
Integer totalCount; Integer totalCount;
@ApiModelProperty("用例总条数")
Integer useCaseNum;
} }
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