From 7c2c196a2f877ad8aa013b5dcf144e3579b2ab96 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 2 Nov 2023 14:38:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B):?= =?UTF-8?q?=20=E5=88=A0=E9=99=A4=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/FunctionalCaseModule.java | 5 -- .../domain/FunctionalCaseModuleExample.java | 60 ------------------- .../mapper/FunctionalCaseModuleMapper.xml | 43 ++++--------- .../3.0.0/ddl/V3.0.0_10__functional_case.sql | 4 -- .../FunctionalCaseModuleController.java | 2 +- .../mapper/ExtFunctionalCaseMapper.java | 3 + .../mapper/ExtFunctionalCaseMapper.xml | 16 ++++- .../mapper/ExtFunctionalCaseModuleMapper.java | 4 +- .../mapper/ExtFunctionalCaseModuleMapper.xml | 53 ++-------------- .../service/FunctionalCaseModuleService.java | 7 ++- .../FunctionalCaseModuleControllerTests.java | 46 ++++++++++++-- 11 files changed, 81 insertions(+), 162 deletions(-) diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModule.java b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModule.java index 3294570fc4..3825f51bc6 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModule.java @@ -34,10 +34,6 @@ public class FunctionalCaseModule implements Serializable { @NotNull(message = "{functional_case_module.pos.not_blank}", groups = {Created.class}) private Long pos; - @Schema(description = "是否在回收站:0-否,1-是", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{functional_case_module.deleted.not_blank}", groups = {Created.class}) - private Boolean deleted; - @Schema(description = "创建时间") private Long createTime; @@ -58,7 +54,6 @@ public class FunctionalCaseModule implements Serializable { name("name", "name", "VARCHAR", true), parentId("parent_id", "parentId", "VARCHAR", false), pos("pos", "pos", "BIGINT", false), - deleted("deleted", "deleted", "BIT", false), createTime("create_time", "createTime", "BIGINT", false), updateTime("update_time", "updateTime", "BIGINT", false), createUser("create_user", "createUser", "VARCHAR", false), diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModuleExample.java b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModuleExample.java index 6dc548c304..cc8478fdea 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModuleExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/FunctionalCaseModuleExample.java @@ -444,66 +444,6 @@ public class FunctionalCaseModuleExample { return (Criteria) this; } - public Criteria andDeletedIsNull() { - addCriterion("deleted is null"); - return (Criteria) this; - } - - public Criteria andDeletedIsNotNull() { - addCriterion("deleted is not null"); - return (Criteria) this; - } - - public Criteria andDeletedEqualTo(Boolean value) { - addCriterion("deleted =", value, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedNotEqualTo(Boolean value) { - addCriterion("deleted <>", value, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedGreaterThan(Boolean value) { - addCriterion("deleted >", value, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedGreaterThanOrEqualTo(Boolean value) { - addCriterion("deleted >=", value, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedLessThan(Boolean value) { - addCriterion("deleted <", value, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedLessThanOrEqualTo(Boolean value) { - addCriterion("deleted <=", value, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedIn(List values) { - addCriterion("deleted in", values, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedNotIn(List values) { - addCriterion("deleted not in", values, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedBetween(Boolean value1, Boolean value2) { - addCriterion("deleted between", value1, value2, "deleted"); - return (Criteria) this; - } - - public Criteria andDeletedNotBetween(Boolean value1, Boolean value2) { - addCriterion("deleted not between", value1, value2, "deleted"); - return (Criteria) this; - } - public Criteria andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/FunctionalCaseModuleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/FunctionalCaseModuleMapper.xml index c6c1088b46..77b21e0145 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/FunctionalCaseModuleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/FunctionalCaseModuleMapper.xml @@ -7,7 +7,6 @@ - @@ -72,8 +71,7 @@ - id, project_id, `name`, parent_id, pos, deleted, create_time, update_time, create_user, - update_user + id, project_id, `name`, parent_id, pos, create_time, update_time, create_user, update_user - UPDATE functional_case SET deleted = true WHERE module_id IN + UPDATE functional_case SET deleted = true, module_id = 'root' WHERE module_id IN #{id} + + \ No newline at end of file diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseModuleMapper.java b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseModuleMapper.java index 2563d7847f..46a2a168c5 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseModuleMapper.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseModuleMapper.java @@ -8,14 +8,12 @@ import org.apache.ibatis.annotations.Param; import java.util.List; public interface ExtFunctionalCaseModuleMapper { - List selectBaseByProjectId(String projectId); + List selectBaseByProjectId(@Param("projectId")String projectId); List selectChildrenIdsByParentIds(@Param("ids") List deleteIds); List selectChildrenIdsSortByPos(String parentId); - void removeToTrashByIds(@Param("ids") List deleteIds); - Long getMaxPosByParentId(String parentId); BaseModule selectBaseModuleById(String dragNodeId); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseModuleMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseModuleMapper.xml index cac09fa909..5d9f1a3422 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseModuleMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseModuleMapper.xml @@ -4,14 +4,9 @@ - - - - UPDATE functional_case_module SET deleted = true WHERE id IN - - #{id} - - - - - - +