From d4d730781929de8306e9e763ee64a66c42db030b Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Sun, 22 Oct 2023 21:13:35 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E8=A1=A5=E5=85=85=E6=A8=A1=E6=9D=BF=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/system/domain/StatusItem.java | 4 +- .../metersphere/system/domain/Template.java | 5 - .../system/domain/TemplateExample.java | 60 ---- .../system/mapper/TemplateMapper.xml | 34 +-- .../3.0.0/ddl/V3.0.0_11__system_setting.sql | 8 +- .../migration/3.0.0/dml/V3.0.0_11_1__data.sql | 40 +-- .../plugin/platform/spi/Platform.java | 16 + .../sdk/constants/InternalUser.java | 20 ++ .../sdk/constants/ProjectApplicationType.java | 20 ++ .../io/metersphere/sdk/dto/TemplateDTO.java | 2 + .../main/resources/i18n/commons.properties | 2 +- .../resources/i18n/commons_en_US.properties | 2 +- .../resources/i18n/commons_zh_CN.properties | 2 +- .../resources/i18n/commons_zh_TW.properties | 2 +- .../main/resources/i18n/project.properties | 2 + .../resources/i18n/project_en_US.properties | 3 +- .../resources/i18n/project_zh_CN.properties | 3 +- .../resources/i18n/project_zh_TW.properties | 1 + .../controller/ProjectTemplateController.java | 13 +- .../project/dto/ProjectTemplateDTO.java | 22 ++ .../project/dto/ProjectTemplateOptionDTO.java | 22 ++ .../service/ProjectApplicationService.java | 8 +- .../service/ProjectTemplateService.java | 281 +++++++++++++++++- .../ProjectTemplateControllerTests.java | 156 +++++++--- .../file/metersphere-jira-plugin-3.x.jar | Bin 46945 -> 46636 bytes .../OrganizationTemplateController.java | 8 - .../system/service/BaseTemplateService.java | 50 +--- .../service/OrganizationTemplateService.java | 30 +- .../service/ServiceIntegrationService.java | 2 +- .../system/base/BasePluginTestService.java | 151 ++++++++++ .../OrganizationTemplateControllerTests.java | 48 +-- .../ServiceIntegrationControllerTests.java | 74 +---- 32 files changed, 722 insertions(+), 369 deletions(-) create mode 100644 backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/InternalUser.java create mode 100644 backend/services/project-management/src/main/java/io/metersphere/project/dto/ProjectTemplateDTO.java create mode 100644 backend/services/project-management/src/main/java/io/metersphere/project/dto/ProjectTemplateOptionDTO.java create mode 100644 backend/services/system-setting/src/test/java/io/metersphere/system/base/BasePluginTestService.java diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/StatusItem.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/StatusItem.java index 49b762bed9..b7289f3fbb 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/StatusItem.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/StatusItem.java @@ -37,9 +37,7 @@ public class StatusItem implements Serializable { @Size(min = 1, max = 50, message = "{status_item.scope_type.length_range}", groups = {Created.class, Updated.class}) private String scopeType; - @Schema(description = "项目状态所关联的组织状态ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{status_item.ref_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{status_item.ref_id.length_range}", groups = {Created.class, Updated.class}) + @Schema(description = "项目状态所关联的组织状态ID") private String refId; @Schema(description = "组织或项目ID", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Template.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Template.java index 749cbc0c35..0da552124a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Template.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Template.java @@ -50,10 +50,6 @@ public class Template implements Serializable { @NotNull(message = "{template.enable_third_part.not_blank}", groups = {Created.class}) private Boolean enableThirdPart; - @Schema(description = "是否是默认模板", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{template.enable_default.not_blank}", groups = {Created.class}) - private Boolean enableDefault; - @Schema(description = "项目模板所关联的组织模板ID") private String refId; @@ -75,7 +71,6 @@ public class Template implements Serializable { scopeType("scope_type", "scopeType", "VARCHAR", false), scopeId("scope_id", "scopeId", "VARCHAR", false), enableThirdPart("enable_third_part", "enableThirdPart", "BIT", false), - enableDefault("enable_default", "enableDefault", "BIT", false), refId("ref_id", "refId", "VARCHAR", false), scene("scene", "scene", "VARCHAR", false); diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/TemplateExample.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/TemplateExample.java index 86d1d22ecd..feffbfd0e6 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/TemplateExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/TemplateExample.java @@ -764,66 +764,6 @@ public class TemplateExample { return (Criteria) this; } - public Criteria andEnableDefaultIsNull() { - addCriterion("enable_default is null"); - return (Criteria) this; - } - - public Criteria andEnableDefaultIsNotNull() { - addCriterion("enable_default is not null"); - return (Criteria) this; - } - - public Criteria andEnableDefaultEqualTo(Boolean value) { - addCriterion("enable_default =", value, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultNotEqualTo(Boolean value) { - addCriterion("enable_default <>", value, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultGreaterThan(Boolean value) { - addCriterion("enable_default >", value, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultGreaterThanOrEqualTo(Boolean value) { - addCriterion("enable_default >=", value, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultLessThan(Boolean value) { - addCriterion("enable_default <", value, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultLessThanOrEqualTo(Boolean value) { - addCriterion("enable_default <=", value, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultIn(List values) { - addCriterion("enable_default in", values, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultNotIn(List values) { - addCriterion("enable_default not in", values, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultBetween(Boolean value1, Boolean value2) { - addCriterion("enable_default between", value1, value2, "enableDefault"); - return (Criteria) this; - } - - public Criteria andEnableDefaultNotBetween(Boolean value1, Boolean value2) { - addCriterion("enable_default not between", value1, value2, "enableDefault"); - return (Criteria) this; - } - public Criteria andRefIdIsNull() { addCriterion("ref_id is null"); return (Criteria) this; diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TemplateMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TemplateMapper.xml index 311b8da9c1..39e9e7b686 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TemplateMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TemplateMapper.xml @@ -12,7 +12,6 @@ - @@ -76,7 +75,7 @@ id, `name`, remark, internal, update_time, create_time, create_user, scope_type, - scope_id, enable_third_part, enable_default, ref_id, scene + scope_id, enable_third_part, ref_id, scene