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