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 142343a059..4cbc2280d9 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 @@ -8,6 +8,7 @@ import io.metersphere.plan.constants.AssociateCaseType; import io.metersphere.plan.constants.TestPlanResourceConfig; import io.metersphere.plan.dto.ReportDetailCasePageDTO; import io.metersphere.plan.dto.request.*; +import io.metersphere.plan.dto.response.TestPlanCaseExecHistoryResponse; import io.metersphere.plan.dto.response.TestPlanReportDetailResponse; import io.metersphere.plan.dto.response.TestPlanReportPageResponse; import io.metersphere.plan.service.*; @@ -141,6 +142,14 @@ public class TestPlanReportController { return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailCases(request, AssociateCaseType.FUNCTIONAL)); } + @GetMapping("/detail/functional/case/step/{reportId}") + @Operation(summary = "测试计划-报告-详情-功能用例-执行步骤结果") + @RequiresPermissions(value = {PermissionConstants.TEST_PLAN_REPORT_READ, PermissionConstants.TEST_PLAN_READ_EXECUTE}, logical = Logical.OR) + @CheckOwner(resourceId = "#reportId", resourceType = "test_plan_case_execute_history") + public TestPlanCaseExecHistoryResponse getFunctionalExecuteResult(@PathVariable String reportId) { + return testPlanReportService.getFunctionalExecuteResult(reportId); + } + @PostMapping("/detail/api/case/page") @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/controller/TestPlanReportShareController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java index 60cf4b74d0..9062299ce6 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportShareController.java @@ -14,6 +14,7 @@ import io.metersphere.plan.dto.ReportDetailCasePageDTO; import io.metersphere.plan.dto.TestPlanShareInfo; import io.metersphere.plan.dto.request.TestPlanReportShareRequest; import io.metersphere.plan.dto.request.TestPlanShareReportDetailRequest; +import io.metersphere.plan.dto.response.TestPlanCaseExecHistoryResponse; import io.metersphere.plan.dto.response.TestPlanReportDetailResponse; import io.metersphere.plan.dto.response.TestPlanShareResponse; import io.metersphere.plan.service.TestPlanReportService; @@ -163,4 +164,12 @@ public class TestPlanReportShareController { testPlanReportShareService.validateExpired(shareInfo); return apiScenarioReportService.getDetail(reportId, stepId); } + + @GetMapping("/detail/functional/case/step/{shareId}/{reportId}") + @Operation(summary = "测试计划-报告-详情-功能用例-执行步骤结果") + public TestPlanCaseExecHistoryResponse getFunctionalExecuteResult(@PathVariable String shareId, @PathVariable String reportId) { + ShareInfo shareInfo = testPlanReportShareService.checkResource(shareId); + testPlanReportShareService.validateExpired(shareInfo); + return testPlanReportService.getFunctionalExecuteResult(reportId); + } } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java index 98a7aa5211..189d7334bc 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.java @@ -14,4 +14,6 @@ public interface ExtTestPlanCaseExecuteHistoryMapper { List getCaseExecHistory(@Param("request") TestPlanCaseExecHistoryRequest request); List selectSteps(@Param("testPlanCaseId") String testPlanCaseId, @Param("caseId") String caseId); + + TestPlanCaseExecHistoryResponse getSingleExecHistory(@Param("id") String id); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml index d37ffef962..74bd11c9fe 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanCaseExecuteHistoryMapper.xml @@ -37,6 +37,27 @@ tpceh.create_time DESC + +