refactor(接口测试): 优化报告获取步骤数
This commit is contained in:
parent
a4726a03ef
commit
d6a0932361
|
@ -18,5 +18,7 @@ public class ApiReportDTO extends ApiReport {
|
||||||
private String environmentName;
|
private String environmentName;
|
||||||
@Schema(description = "创建人")
|
@Schema(description = "创建人")
|
||||||
private String creatUserName;
|
private String creatUserName;
|
||||||
|
@Schema(description = "步骤总数")
|
||||||
|
private Long total;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,5 +20,7 @@ public class ApiScenarioReportDTO extends ApiScenarioReport {
|
||||||
private String environmentName;
|
private String environmentName;
|
||||||
@Schema(description = "创建人")
|
@Schema(description = "创建人")
|
||||||
private String creatUserName;
|
private String creatUserName;
|
||||||
|
@Schema(description = "请求总数")
|
||||||
|
private Long requestTotal;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,6 +177,7 @@ public class ApiReportService {
|
||||||
ApiReport apiReport = checkResource(id);
|
ApiReport apiReport = checkResource(id);
|
||||||
BeanUtils.copyBean(apiReportDTO, apiReport);
|
BeanUtils.copyBean(apiReportDTO, apiReport);
|
||||||
//查询console
|
//查询console
|
||||||
|
apiReportDTO.setTotal(apiReportDTO.getErrorCount() + apiReportDTO.getSuccessCount() + apiReportDTO.getPendingCount() + apiReportDTO.getFakeErrorCount());
|
||||||
ApiReportLogExample consoleExample = new ApiReportLogExample();
|
ApiReportLogExample consoleExample = new ApiReportLogExample();
|
||||||
consoleExample.createCriteria().andReportIdEqualTo(id);
|
consoleExample.createCriteria().andReportIdEqualTo(id);
|
||||||
List<ApiReportLog> apiReportLogs = apiReportLogMapper.selectByExampleWithBLOBs(consoleExample);
|
List<ApiReportLog> apiReportLogs = apiReportLogMapper.selectByExampleWithBLOBs(consoleExample);
|
||||||
|
|
|
@ -189,6 +189,7 @@ public class ApiScenarioReportService {
|
||||||
steps.sort(Comparator.comparingLong(ApiScenarioReportStepDTO::getSort));
|
steps.sort(Comparator.comparingLong(ApiScenarioReportStepDTO::getSort));
|
||||||
getStepTree(steps, scenarioReportStepMap);
|
getStepTree(steps, scenarioReportStepMap);
|
||||||
scenarioReportDTO.setStepTotal(steps.size());
|
scenarioReportDTO.setStepTotal(steps.size());
|
||||||
|
scenarioReportDTO.setRequestTotal(scenarioReportDTO.getErrorCount() + scenarioReportDTO.getPendingCount() + scenarioReportDTO.getSuccessCount() + scenarioReportDTO.getFakeErrorCount());
|
||||||
scenarioReportDTO.setChildren(steps);
|
scenarioReportDTO.setChildren(steps);
|
||||||
//控制台信息 console
|
//控制台信息 console
|
||||||
ApiScenarioReportLogExample example = new ApiScenarioReportLogExample();
|
ApiScenarioReportLogExample example = new ApiScenarioReportLogExample();
|
||||||
|
|
Loading…
Reference in New Issue