Commit b491d203 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

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

See merge request !309
parents 01fdac3a 098d3931
......@@ -79,4 +79,11 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
* @throws IOException
*/
InspectionContentResponse getList(String request) throws IOException;
/**
* 检验内容库查询标准下测试用例(科恩)
* @param request
* @return
*/
List<UseCaseListResponse> getUseCaseList(String request) throws IOException ;
}
......@@ -220,6 +220,8 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
Response response = client.newCall(requestKE).execute();
String string = response.body().string();
JSONObject jsonObject = JSONObject.parseObject(string);
if (jsonObject.getJSONObject("data").getJSONObject("regulationByName") != null) {
// 获取测试用例
List<InspectionContentVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", InspectionContentVO.class);
inspectionContentResponse.setInspectionContent(list);
......@@ -227,7 +229,20 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
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;
}
@Override
public List<UseCaseListResponse> getUseCaseList(String request) throws IOException {
// TODO 检验内容库查询标准下测试用例(科恩)
return null;
}
/**
......
......@@ -137,4 +137,20 @@ public class ReviewStandardController extends BaseController {
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 {
* 大标准ID
*/
@ApiModelProperty("总标准ID")
@NotNull(message = "总标准ID不能为空")
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