diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java index 0dca27ef5e..3b419883f8 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java @@ -127,13 +127,21 @@ public class TestPlanReportController { } @GetMapping("/get-task/{taskId}") - @Operation(summary = "测试计划|组-任务-执行结果") + @Operation(summary = "测试计划|组-执行历史-执行结果") @RequiresPermissions(value = {PermissionConstants.TEST_PLAN_REPORT_READ, PermissionConstants.TEST_PLAN_READ_EXECUTE}, logical = Logical.OR) @CheckOwner(resourceId = "#taskId", resourceType = "exec_task") public TestPlanTaskReportResponse getTaskDetail(@PathVariable String taskId) { return testPlanReportService.getTaskDetail(taskId); } + @GetMapping("/get-result/{taskId}") + @Operation(summary = "测试计划|组-任务-执行结果") + @RequiresPermissions(value = {PermissionConstants.TEST_PLAN_REPORT_READ, PermissionConstants.TEST_PLAN_READ_EXECUTE}, logical = Logical.OR) + @CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report") + public TestPlanReportDetailResponse getTaskResult(@PathVariable String taskId) { + return testPlanReportService.getTaskResult(taskId); + } + @GetMapping("/get-layout/{reportId}") @Operation(summary = "测试计划-报告-组件布局") @RequiresPermissions(value = {PermissionConstants.TEST_PLAN_REPORT_READ, PermissionConstants.TEST_PLAN_READ_EXECUTE}, logical = Logical.OR) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanExecuteHisDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanExecuteHisDTO.java index d743000414..cf35ecd61e 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanExecuteHisDTO.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanExecuteHisDTO.java @@ -24,4 +24,8 @@ public class TestPlanExecuteHisDTO { private Long endTime; @Schema(description = "报告是否删除") private Boolean deleted; + @Schema(description = "报告ID") + private String reportId; + @Schema(description = "执行结果是否删除") + private Boolean resultDeleted; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanTaskReportResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanTaskReportResponse.java index 238bb31fe4..a76f2755f6 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanTaskReportResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanTaskReportResponse.java @@ -6,6 +6,7 @@ import io.metersphere.system.serializer.CustomRateSerializer; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; import java.util.List; @@ -15,6 +16,7 @@ import java.util.List; @Data public class TestPlanTaskReportResponse implements Serializable { + @Serial private static final long serialVersionUID = 1L; @Schema(description = "报告ID") @@ -40,10 +42,16 @@ public class TestPlanTaskReportResponse implements Serializable { @Schema(description = "执行完成率(实时)") @JsonSerialize(using = CustomRateSerializer.class) private Double executeRate; + @Schema(description = "接口明细总数") + private Integer apiCaseTotal; + @Schema(description = "场景明细总数") + private Integer apiScenarioTotal; @Data public static class ChildPlan { private String id; private String name; + private Integer apiCaseTotal; + private Integer apiScenarioTotal; } } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml index a165dfd44f..33515b7e75 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml @@ -659,7 +659,7 @@