From 9951b73c7c442e2574714779744a14af863db37c Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 31 Jan 2024 20:21:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E7=BB=9F=E4=B8=80=E4=BF=AE=E6=94=B9=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B5=84=E6=BA=90=E6=B1=A0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/domain/CaseReviewModule.java | 2 +- .../domain/FunctionalCaseModule.java | 2 +- .../system/domain/Organization.java | 27 ++++++------- .../system/domain/TestResourcePool.java | 39 +++++++++---------- .../3.0.0/ddl/V3.0.0_10__functional_case.sql | 4 +- .../3.0.0/ddl/V3.0.0_11__system_setting.sql | 6 +-- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/CaseReviewModule.java b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/CaseReviewModule.java index 6c8b7a84ad..cf82b1e9db 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/CaseReviewModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/CaseReviewModule.java @@ -22,7 +22,7 @@ public class CaseReviewModule implements Serializable { @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{case_review_module.name.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 100, message = "{case_review_module.name.length_range}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 255, message = "{case_review_module.name.length_range}", groups = {Created.class, Updated.class}) private String name; @Schema(description = "父节点ID", requiredMode = Schema.RequiredMode.REQUIRED) 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 3825f51bc6..3458cf28fb 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 @@ -22,7 +22,7 @@ public class FunctionalCaseModule implements Serializable { @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{functional_case_module.name.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 100, message = "{functional_case_module.name.length_range}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 255, message = "{functional_case_module.name.length_range}", groups = {Created.class, Updated.class}) private String name; @Schema(description = "父节点ID", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Organization.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Organization.java index 7649fd2464..de902776c6 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Organization.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Organization.java @@ -10,44 +10,45 @@ import lombok.Data; @Data public class Organization implements Serializable { - @Schema(description = "组织ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "组织ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{organization.id.not_blank}", groups = {Updated.class}) @Size(min = 1, max = 50, message = "{organization.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(description = "组织编号") + @Schema(description = "组织编号") private Long num; - @Schema(description = "组织名称", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "组织名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{organization.name.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 100, message = "{organization.name.length_range}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 255, message = "{organization.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(description = "描述") + @Schema(description = "描述") private String description; - @Schema(description = "创建时间") + @Schema(description = "创建时间") private Long createTime; - @Schema(description = "更新时间") + @Schema(description = "更新时间") private Long updateTime; - @Schema(description = "创建人") + @Schema(description = "创建人") private String createUser; - @Schema(description = "修改人") + @Schema(description = "修改人") private String updateUser; - @Schema(description = "是否删除") + @Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{organization.deleted.not_blank}", groups = {Created.class}) private Boolean deleted; - @Schema(description = "删除人") + @Schema(description = "删除人") private String deleteUser; - @Schema(description = "删除时间") + @Schema(description = "删除时间") private Long deleteTime; - @Schema(description = "是否启用") + @Schema(description = "是否启用") private Boolean enable; private static final long serialVersionUID = 1L; diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResourcePool.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResourcePool.java index 87e8342524..ecd6449f99 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResourcePool.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResourcePool.java @@ -1,64 +1,63 @@ package io.metersphere.system.domain; -import io.metersphere.validation.groups.Created; -import io.metersphere.validation.groups.Updated; +import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; -import lombok.Data; - +import jakarta.validation.constraints.*; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; +import lombok.Data; @Data public class TestResourcePool implements Serializable { - @Schema(description = "资源池ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "资源池ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_resource_pool.id.not_blank}", groups = {Updated.class}) @Size(min = 1, max = 50, message = "{test_resource_pool.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_resource_pool.name.not_blank}", groups = {Created.class}) @Size(min = 1, max = 255, message = "{test_resource_pool.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_resource_pool.type.not_blank}", groups = {Created.class}) @Size(min = 1, max = 30, message = "{test_resource_pool.type.length_range}", groups = {Created.class, Updated.class}) private String type; - @Schema(description = "描述") + @Schema(description = "描述") private String description; - @Schema(description = "是否启用") + @Schema(description = "是否启用") private Boolean enable; - @Schema(description = "创建时间") + @Schema(description = "创建时间") private Long createTime; - @Schema(description = "更新时间") + @Schema(description = "更新时间") private Long updateTime; - @Schema(description = "创建人") + @Schema(description = "创建人") private String createUser; - @Schema(description = "是否用于接口测试") + @Schema(description = "是否用于接口测试") private Boolean apiTest; - @Schema(description = "是否用于性能测试") + @Schema(description = "是否用于性能测试") private Boolean loadTest; - @Schema(description = "是否用于ui测试") + @Schema(description = "是否用于ui测试") private Boolean uiTest; - @Schema(description = "ms部署地址") + @Schema(description = "ms部署地址") private String serverUrl; - @Schema(description = "资源池应用类型(组织/全部)") + @Schema(description = "资源池应用类型(组织/全部)", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{test_resource_pool.all_org.not_blank}", groups = {Created.class}) private Boolean allOrg; - @Schema(description = "是否删除") + @Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{test_resource_pool.deleted.not_blank}", groups = {Created.class}) private Boolean deleted; private static final long serialVersionUID = 1L; diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql index e7284ad00f..763954563f 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_10__functional_case.sql @@ -83,7 +83,7 @@ CREATE TABLE IF NOT EXISTS functional_case_module ( `id` VARCHAR(50) NOT NULL COMMENT 'ID', `project_id` VARCHAR(50) NOT NULL COMMENT '项目ID', - `name` VARCHAR(100) NOT NULL COMMENT '名称', + `name` VARCHAR(255) NOT NULL COMMENT '名称', `parent_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '父节点ID', `pos` BIGINT NOT NULL DEFAULT 0 COMMENT '同一节点下的顺序', `create_time` BIGINT NOT NULL COMMENT '创建时间', @@ -372,7 +372,7 @@ CREATE TABLE IF NOT EXISTS case_review_module ( `id` VARCHAR(50) NOT NULL COMMENT 'ID', `project_id` VARCHAR(50) NOT NULL COMMENT '项目ID', - `name` VARCHAR(100) NOT NULL COMMENT '名称', + `name` VARCHAR(255) NOT NULL COMMENT '名称', `parent_id` VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '父节点ID', `pos` BIGINT NOT NULL DEFAULT 0 COMMENT '同一节点下的顺序', `create_time` BIGINT NOT NULL COMMENT '创建时间', diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql index a96069a405..c4b498d6b0 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql @@ -178,7 +178,7 @@ CREATE TABLE test_resource_pool( `id` VARCHAR(50) NOT NULL COMMENT '资源池ID' , `name` VARCHAR(255) NOT NULL COMMENT '名称' , `type` VARCHAR(30) NOT NULL COMMENT '类型' , - `description` VARCHAR(500) COMMENT '描述' , + `description` VARCHAR(1000) COMMENT '描述' , `enable` BIT NOT NULL DEFAULT 1 COMMENT '是否启用' , `create_time` BIGINT NOT NULL COMMENT '创建时间' , `update_time` BIGINT NOT NULL COMMENT '更新时间' , @@ -296,8 +296,8 @@ CREATE TABLE IF NOT EXISTS organization ( `id` VARCHAR(50) NOT NULL COMMENT '组织ID', `num` BIGINT NOT NULL AUTO_INCREMENT COMMENT '组织编号', - `name` VARCHAR(100) NOT NULL COMMENT '组织名称', - `description` VARCHAR(500) COMMENT '描述', + `name` VARCHAR(255) NOT NULL COMMENT '组织名称', + `description` VARCHAR(1000) COMMENT '描述', `create_time` BIGINT NOT NULL COMMENT '创建时间', `update_time` BIGINT NOT NULL COMMENT '更新时间', `create_user` VARCHAR(50) NOT NULL COMMENT '创建人',