Commit 098d3931 authored by wdy's avatar wdy

检验内容库查询标准下测试用例(科恩)

parent 01fdac3a
...@@ -79,4 +79,11 @@ public interface ReviewStandardService extends IService<ReviewStandard> { ...@@ -79,4 +79,11 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
* @throws IOException * @throws IOException
*/ */
InspectionContentResponse getList(String request) throws IOException; InspectionContentResponse getList(String request) throws IOException;
/**
* 检验内容库查询标准下测试用例(科恩)
* @param request
* @return
*/
List<UseCaseListResponse> getUseCaseList(String request) throws IOException ;
} }
...@@ -220,14 +220,29 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper, ...@@ -220,14 +220,29 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
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<InspectionContentVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", InspectionContentVO.class); if (jsonObject.getJSONObject("data").getJSONObject("regulationByName") != null) {
inspectionContentResponse.setInspectionContent(list); // 获取测试用例
// 获取总条数 List<InspectionContentVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", InspectionContentVO.class);
Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount"); inspectionContentResponse.setInspectionContent(list);
inspectionContentResponse.setTotalCount(totalCount); // 获取总条数
Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount");
inspectionContentResponse.setTotalCount(totalCount);
} else {
List<InspectionContentVO> list = new ArrayList<>();
inspectionContentResponse.setInspectionContent(list);
inspectionContentResponse.setTotalCount(0);
}
return inspectionContentResponse; return inspectionContentResponse;
}
@Override
public List<UseCaseListResponse> getUseCaseList(String request) throws IOException {
// TODO 检验内容库查询标准下测试用例(科恩)
return null;
} }
/** /**
......
...@@ -137,4 +137,20 @@ public class ReviewStandardController extends BaseController { ...@@ -137,4 +137,20 @@ public class ReviewStandardController extends BaseController {
return R.ok(reviewStandardService.getList(request)); return R.ok(reviewStandardService.getList(request));
} }
/**
* 检验内容库查询标准下测试用例(科恩)
* @param request
* @return
* @throws IOException
*/
@ApiOperation("检验内容库查询标准下测试用例(科恩)")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getUseCaseList", produces="application/json;charset=UTF-8")
public TableDataInfo<UseCaseListResponse> getUseCaseList(@Validated @RequestBody String request) throws IOException {
return getDataTable(reviewStandardService.getUseCaseList(request));
}
} }
...@@ -20,7 +20,6 @@ public class ReviewStandardListByPageRequest extends PageDomain { ...@@ -20,7 +20,6 @@ public class ReviewStandardListByPageRequest extends PageDomain {
* 大标准ID * 大标准ID
*/ */
@ApiModelProperty("总标准ID") @ApiModelProperty("总标准ID")
@NotNull(message = "总标准ID不能为空")
private Long standardId; private Long standardId;
/** /**
......
package com.ruoyi.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "UseCaseListResponse", description = "查询标准下测试用例")
@Data
public class UseCaseListResponse {
@ApiModelProperty("测试场景")
private String testScenario;
@ApiModelProperty("测试方法")
private String testMethod;
@ApiModelProperty("用例编号")
private String displayID;
@ApiModelProperty("用例名称")
private String name;
}
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