From 7c4e964e74116de77f8be446f4fae40e18cd6493 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Sat, 12 Oct 2024 11:18:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E5=9C=BA=E6=99=AF=E5=AF=BC=E5=85=A5=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A2=9E=E5=8A=A0config=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../definition/ApiTestCaseAssociateDTO.java | 15 ++++ .../api/mapper/ExtApiDefinitionMapper.xml | 3 + .../api/mapper/ExtApiTestCaseMapper.java | 6 ++ .../api/mapper/ExtApiTestCaseMapper.xml | 86 +++++++++++++++++-- .../ApiScenarioSelectAssociateService.java | 27 ++++-- 5 files changed, 123 insertions(+), 14 deletions(-) create mode 100644 backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiTestCaseAssociateDTO.java diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiTestCaseAssociateDTO.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiTestCaseAssociateDTO.java new file mode 100644 index 0000000000..dd55f1ac58 --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiTestCaseAssociateDTO.java @@ -0,0 +1,15 @@ +package io.metersphere.api.dto.definition; + +import io.metersphere.api.domain.ApiTestCase; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ApiTestCaseAssociateDTO extends ApiTestCase { + + @Schema(description = "请求方法") + private String method; + + @Schema(description = "协议") + private String protocol; +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml index c0a8a85f0a..f0c622284a 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml @@ -688,6 +688,7 @@ api_definition.num, api_definition.project_id, api_definition.version_id, + api_definition.protocol, api_definition.pos from api_definition where api_definition.deleted = false @@ -709,6 +710,7 @@ api_definition.num, api_definition.project_id, api_definition.version_id, + api_definition.protocol, api_definition.pos from api_definition where api_definition.deleted = false @@ -733,6 +735,7 @@ api_definition.num, api_definition.project_id, api_definition.version_id, + api_definition.protocol, api_definition.pos from api_definition where api_definition.deleted = false diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.java index 0394f3a5a9..19b2dad415 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.java @@ -111,6 +111,12 @@ public interface ExtApiTestCaseMapper { List getListBySelectIds(@Param("projectId") String projectId, @Param("ids") List ids, @Param("testPlanId") String testPlanId, @Param("protocols") List protocols); + ListselectAllApiCaseWithAssociate(@Param("projectId") String projectId, @Param("protocols") List protocols); + + List getListBySelectModulesWithAssociate(@Param("projectId") String projectId, @Param("moduleIds") List moduleIds, @Param("protocols") List protocols); + + List getListBySelectIdsWithAssociate(@Param("projectId") String projectId, @Param("ids") List ids, @Param("protocols") List protocols); + List getCaseListBySelectIds(@Param("isRepeat") boolean isRepeat, @Param("projectId") String projectId, @Param("ids") List ids, @Param("testPlanId") String testPlanId, @Param("protocols") List protocols); void setApiChangeByApiDefinitionId(@Param("apiDefinitionId") String apiDefinitionId); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml index 48e3ce5af0..4d0f1b71c0 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiTestCaseMapper.xml @@ -766,10 +766,6 @@ api_test_case.id, api_test_case.create_user, api_test_case.environment_id, - api_test_case.name, - api_test_case.project_id, - api_test_case.num, - api_test_case.version_id, api_test_case.pos from api_test_case INNER JOIN api_definition ON api_test_case.api_definition_id = api_definition.id @@ -795,10 +791,6 @@ api_test_case.id, api_test_case.create_user, api_test_case.environment_id, - api_test_case.name, - api_test_case.project_id, - api_test_case.num, - api_test_case.version_id, api_test_case.pos from api_test_case inner join api_definition on api_definition.id = api_test_case.api_definition_id @@ -822,6 +814,54 @@ + + + + + + +