Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
139 additions
and
821 deletions.
There are no files selected for viewing
43 changes: 0 additions & 43 deletions
43
...ces/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,12 @@ | ||
package io.metersphere.plan.controller; | ||
|
||
import io.metersphere.plan.constants.TestPlanResourceConfig; | ||
import io.metersphere.plan.dto.request.ResourceSortRequest; | ||
import io.metersphere.plan.dto.request.TestPlanAssociationRequest; | ||
import io.metersphere.plan.dto.response.TestPlanAssociationResponse; | ||
import io.metersphere.plan.dto.response.TestPlanResourceSortResponse; | ||
import io.metersphere.plan.service.TestPlanApiCaseService; | ||
import io.metersphere.plan.service.TestPlanManagementService; | ||
import io.metersphere.sdk.constants.HttpMethodConstants; | ||
import io.metersphere.sdk.constants.PermissionConstants; | ||
import io.metersphere.system.dto.LogInsertModule; | ||
import io.metersphere.system.security.CheckOwner; | ||
import io.metersphere.system.utils.SessionUtils; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.annotation.Resource; | ||
import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.Collections; | ||
|
||
@Tag(name = "测试计划接口用例") | ||
@RestController | ||
@RequestMapping("/test-plan/api/case") | ||
public class TestPlanApiCaseController { | ||
|
||
@Resource | ||
private TestPlanManagementService testPlanManagementService; | ||
@Resource | ||
private TestPlanApiCaseService testPlanApiCaseService; | ||
|
||
@PostMapping(value = "/association") | ||
@Operation(summary = "测试计划接口用例-关联接口用例") | ||
@RequiresPermissions(PermissionConstants.TEST_PLAN_READ_ASSOCIATION) | ||
@CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan") | ||
public TestPlanAssociationResponse association(@Validated @RequestBody TestPlanAssociationRequest request) { | ||
testPlanManagementService.checkModuleIsOpen(request.getTestPlanId(), TestPlanResourceConfig.CHECK_TYPE_TEST_PLAN, Collections.singletonList(TestPlanResourceConfig.CONFIG_TEST_PLAN_API_CASE)); | ||
return testPlanApiCaseService.association(request, new LogInsertModule(SessionUtils.getUserId(), "/test-plan/api/case/association", HttpMethodConstants.POST.name())); | ||
} | ||
|
||
@PostMapping(value = "/sort") | ||
@Operation(summary = "测试计划接口用例-关联功能用例") | ||
@RequiresPermissions(PermissionConstants.TEST_PLAN_READ_UPDATE) | ||
@CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan") | ||
public TestPlanResourceSortResponse sortNode(@Validated @RequestBody ResourceSortRequest request) { | ||
testPlanManagementService.checkModuleIsOpen(request.getTestPlanId(), TestPlanResourceConfig.CHECK_TYPE_TEST_PLAN, Collections.singletonList(TestPlanResourceConfig.CONFIG_TEST_PLAN_API_CASE)); | ||
return testPlanApiCaseService.sortNode(request, new LogInsertModule(SessionUtils.getUserId(), "/test-plan/api/case/sort", HttpMethodConstants.POST.name())); | ||
} | ||
|
||
} |
42 changes: 0 additions & 42 deletions
42
...test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,13 @@ | ||
package io.metersphere.plan.controller; | ||
|
||
import io.metersphere.plan.constants.TestPlanResourceConfig; | ||
import io.metersphere.plan.dto.request.ResourceSortRequest; | ||
import io.metersphere.plan.dto.request.TestPlanAssociationRequest; | ||
import io.metersphere.plan.dto.response.TestPlanAssociationResponse; | ||
import io.metersphere.plan.dto.response.TestPlanResourceSortResponse; | ||
import io.metersphere.plan.service.TestPlanApiScenarioService; | ||
import io.metersphere.plan.service.TestPlanManagementService; | ||
import io.metersphere.sdk.constants.HttpMethodConstants; | ||
import io.metersphere.sdk.constants.PermissionConstants; | ||
import io.metersphere.system.dto.LogInsertModule; | ||
import io.metersphere.system.security.CheckOwner; | ||
import io.metersphere.system.utils.SessionUtils; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.annotation.Resource; | ||
import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.Collections; | ||
|
||
@Tag(name = "测试计划场景用例") | ||
@RestController | ||
@RequestMapping("/test-plan/api/scenario") | ||
public class TestPlanApiScenarioController { | ||
|
||
@Resource | ||
private TestPlanManagementService testPlanManagementService; | ||
@Resource | ||
private TestPlanApiScenarioService testPlanApiScenarioService; | ||
|
||
@PostMapping(value = "/association") | ||
@Operation(summary = "测试计划场景用例-关联接口用例") | ||
@RequiresPermissions(PermissionConstants.TEST_PLAN_READ_ASSOCIATION) | ||
@CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan") | ||
public TestPlanAssociationResponse association(@Validated @RequestBody TestPlanAssociationRequest request) { | ||
testPlanManagementService.checkModuleIsOpen(request.getTestPlanId(), TestPlanResourceConfig.CHECK_TYPE_TEST_PLAN, Collections.singletonList(TestPlanResourceConfig.CONFIG_TEST_PLAN_API_SCENARIO)); | ||
return testPlanApiScenarioService.association(request, new LogInsertModule(SessionUtils.getUserId(), "/test-plan/api/scenario/association", HttpMethodConstants.POST.name())); | ||
} | ||
|
||
@PostMapping(value = "/sort") | ||
@Operation(summary = "测试计划场景用例-关联功能用例") | ||
@RequiresPermissions(PermissionConstants.TEST_PLAN_READ_UPDATE) | ||
@CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan") | ||
public TestPlanResourceSortResponse sortNode(@Validated @RequestBody ResourceSortRequest request) { | ||
testPlanManagementService.checkModuleIsOpen(request.getTestPlanId(), TestPlanResourceConfig.CHECK_TYPE_TEST_PLAN, Collections.singletonList(TestPlanResourceConfig.CONFIG_TEST_PLAN_API_SCENARIO)); | ||
return testPlanApiScenarioService.sortNode(request, new LogInsertModule(SessionUtils.getUserId(), "/test-plan/api/scenario/sort", HttpMethodConstants.POST.name())); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.