From 3c26e9e4326f333b324839634cb88bfc7b23f45d Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 20 Nov 2023 17:29:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96svg=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=9B=BE=E7=9A=84=E4=BC=A0=E8=BE=93=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk/constants/ModuleConstants.java | 4 +-- .../api/mapper/ExtApiDebugModuleMapper.xml | 6 ++-- .../mapper/ExtApiDefinitionModuleMapper.xml | 6 ++-- .../ApiDefinitionModuleService.java | 2 -- .../definition/ApiTestCaseService.java | 3 -- .../project/mapper/ExtFileModuleMapper.java | 2 +- .../project/mapper/ExtFileModuleMapper.xml | 9 ++++- .../project/service/FileMetadataService.java | 33 ++++++++++--------- .../project/service/FileModuleService.java | 8 ++--- .../project/service/ModuleTreeService.java | 6 +--- .../FileManagementControllerTests.java | 22 +++++++++++-- 11 files changed, 59 insertions(+), 42 deletions(-) diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/ModuleConstants.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/ModuleConstants.java index 7f7b31e57d..da1563bc5e 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/ModuleConstants.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/ModuleConstants.java @@ -6,9 +6,9 @@ public class ModuleConstants { //没有父类的节点,parent_id为NONE public static final String ROOT_NODE_PARENT_ID = "NONE"; //默认节点类型 - public static final String NODE_TYPE_DEFAULT = "module"; + public static final String NODE_TYPE_DEFAULT = "MODULE"; //Git节点类型 - public static final String NODE_TYPE_GIT = "git"; + public static final String NODE_TYPE_GIT = "GIT"; //GitHub节点类型 public static final String NODE_TYPE_GITHUB = "Github"; //Gitee节点类型 diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.xml index a286c20b59..9f47cb49d1 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDebugModuleMapper.xml @@ -5,7 +5,7 @@ SELECT id, NAME, parent_id AS parentId, - 'module' AS type + 'MODULE' AS type FROM api_debug_module WHERE protocol = #{protocol} AND create_user = #{userId} @@ -64,7 +64,7 @@ SELECT id, NAME, module_id AS parentId, - 'api' AS type, + 'API' AS type, method FROM api_debug WHERE protocol = #{protocol} @@ -107,7 +107,7 @@ SELECT id, NAME, parent_id AS parentId, - 'module' AS type + 'MODULE' AS type FROM api_debug_module WHERE id IN diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionModuleMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionModuleMapper.xml index 1d913f0807..df86f1bea1 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionModuleMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionModuleMapper.xml @@ -53,7 +53,7 @@ SELECT id, NAME, module_id AS parentId, - 'api' AS type, + 'API' AS type, method FROM api_definition @@ -95,7 +95,7 @@ m.name, m.pos, m.project_id, - 'module' AS type + 'MODULE' AS type FROM api_definition_module m ORDER BY pos @@ -106,7 +106,7 @@ m.name, m.pos, m.project_id, - 'module' AS type + 'MODULE' AS type FROM api_definition_module m WHERE m.id IN diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionModuleService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionModuleService.java index e207291925..36aebd6157 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionModuleService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionModuleService.java @@ -54,8 +54,6 @@ public class ApiDefinitionModuleService extends ModuleTreeService { private ExtApiTestCaseMapper extApiTestCaseMapper; @Resource private ApiTestCaseService apiTestCaseService; - @Resource - private ApiTestCaseLogService apiTestCaseLogService; public List getTree(ApiModuleRequest request) { //接口的树结构是 模块:子模块+接口 接口为非delete状态的 diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java index 77e9585b8f..23920041ef 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java @@ -47,9 +47,6 @@ public class ApiTestCaseService { public static final Long ORDER_STEP = 5000L; - - private static final String MAIN_FOLDER_PROJECT = "project"; - private static final String APP_NAME_API_CASE = "apiCase"; public static final String PRIORITY = "Priority"; public static final String STATUS = "Status"; public static final String TAGS = "Tags"; diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.java b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.java index 9e38d20dff..63db98d032 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.java @@ -10,7 +10,7 @@ import java.util.List; public interface ExtFileModuleMapper { List selectBaseByProjectId(@Param("projectId") String projectId, @Param("moduleType") String moduleType); - List selectIdAndParentIdByProjectId(String projectId); + List selectIdAndParentIdByProjectId(@Param("projectId") String projectId, @Param("storage") String storage); List selectChildrenIdsByParentIds(@Param("ids") List deleteIds); diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.xml b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.xml index 303aa7aadf..845992529f 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.xml +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtFileModuleMapper.xml @@ -11,7 +11,14 @@