diff --git a/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiDefinitionController.java b/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiDefinitionController.java index ca7a61481b..e9ace1f08b 100644 --- a/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiDefinitionController.java +++ b/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiDefinitionController.java @@ -108,7 +108,7 @@ public class ApiDefinitionController { @PostMapping(value = "/create", consumes = {"multipart/form-data"}) - @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API) + @RequiresPermissions(value= {PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_API, PermissionConstants.PROJECT_API_DEFINITION_READ_COPY_API}, logical = Logical.OR) @MsAuditLog(module = OperLogModule.API_DEFINITION, type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = ApiDefinitionService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CREATE, subject = "接口定义通知") public ApiDefinitionResult create(@RequestPart("request") SaveApiDefinitionRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { diff --git a/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiTestCaseController.java b/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiTestCaseController.java index fb08a98f02..a3d891de5c 100644 --- a/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiTestCaseController.java +++ b/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiTestCaseController.java @@ -115,7 +115,7 @@ public class ApiTestCaseController { } @PostMapping(value = "/create", consumes = {"multipart/form-data"}) - @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_CASE) + @RequiresPermissions(value= {PermissionConstants.PROJECT_API_DEFINITION_READ_CREATE_CASE, PermissionConstants.PROJECT_API_DEFINITION_READ_COPY_CASE}, logical = Logical.OR) @MsAuditLog(module = OperLogModule.API_DEFINITION_CASE, type = OperLogConstants.CREATE, title = "#request.name", content = "#msClass.getLogDetails(#request)", msClass = ApiTestCaseService.class) @SendNotice(taskType = NoticeConstants.TaskType.API_DEFINITION_TASK, event = NoticeConstants.Event.CASE_CREATE, subject = "接口用例通知") public ApiTestCase create(@RequestPart("request") SaveApiTestCaseRequest request, @RequestPart(value = "files", required = false) List bodyFiles) { diff --git a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportStructureService.java b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportStructureService.java index ee171a534c..fc00fb0d94 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportStructureService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportStructureService.java @@ -45,8 +45,10 @@ public class ApiScenarioReportStructureService { ElementConstants.ABS_SAMPLER ); private static final List CONTROLS = Arrays.asList( + ElementConstants.IF_CONTROLLER + ); + private static final List CONTROL = Arrays.asList( ElementConstants.ASSERTIONS, - ElementConstants.IF_CONTROLLER, ElementConstants.CONSTANT_TIMER ); private static final String RESOURCE_ID = ElementConstants.RESOURCE_ID; @@ -262,7 +264,7 @@ public class ApiScenarioReportStructureService { stepError.set(stepError.longValue() + 1); } else if (StringUtils.equalsAnyIgnoreCase(step.getTotalStatus(), ERROR_CODE, ApiReportStatus.FAKE_ERROR.name())) { stepErrorCode.set(stepErrorCode.longValue() + 1); - } else if (!StringUtils.equalsIgnoreCase(step.getTotalStatus(), ApiReportStatus.SUCCESS.name())) { + } else if (!StringUtils.equalsIgnoreCase(step.getTotalStatus(), ApiReportStatus.SUCCESS.name()) && !CONTROL.contains(step.getType())) { stepUnExecute.set(stepUnExecute.longValue() + 1); unExecSize++; } @@ -378,7 +380,7 @@ public class ApiScenarioReportStructureService { } } } - if (StringUtils.isEmpty(dto.getTotalStatus())) { + if (StringUtils.isEmpty(dto.getTotalStatus()) && !CONTROL.contains(dto.getType())) { dto.setTotalStatus(ApiReportStatus.PENDING.name()); } else if (StringUtils.equalsAnyIgnoreCase(dto.getTotalStatus(), ApiReportStatus.ERROR.name())) { dto.setTotalStatus(ApiReportStatus.ERROR.name()); diff --git a/api-test/frontend/src/business/definition/components/case/ApiCaseHeader.vue b/api-test/frontend/src/business/definition/components/case/ApiCaseHeader.vue index 3e624e20a9..69cec9a0fa 100644 --- a/api-test/frontend/src/business/definition/components/case/ApiCaseHeader.vue +++ b/api-test/frontend/src/business/definition/components/case/ApiCaseHeader.vue @@ -44,7 +44,10 @@