fix(系统设置): 调整部分字段长度及接口校验

--bug=1035062 --user=宋昌昌 [系统设置]系统-组织-模版-缺陷模版-字段设置,新增字段时描述信息输入超过1000个字符保存提示信息错误 https://www.tapd.cn/55049933/s/1459419
This commit is contained in:
song-cc-rock 2024-02-02 15:21:39 +08:00 committed by 刘瑞斌
parent 067e7dc689
commit 3cbf941b1a
10 changed files with 11 additions and 6 deletions

View File

@ -82,7 +82,7 @@ CREATE TABLE IF NOT EXISTS plugin
`enable` BIT NOT NULL DEFAULT 1 COMMENT '是否启用插件' , `enable` BIT NOT NULL DEFAULT 1 COMMENT '是否启用插件' ,
`global` BIT NOT NULL DEFAULT 1 COMMENT '是否是全局插件' , `global` BIT NOT NULL DEFAULT 1 COMMENT '是否是全局插件' ,
`xpack` BIT NOT NULL DEFAULT 0 COMMENT '是否是企业版插件' , `xpack` BIT NOT NULL DEFAULT 0 COMMENT '是否是企业版插件' ,
`description` VARCHAR(500) COMMENT '插件描述' , `description` VARCHAR(1000) COMMENT '插件描述' ,
`scenario` VARCHAR(50) NOT NULL COMMENT '插件使用场景API_PROTOCOL/PLATFORM' , `scenario` VARCHAR(50) NOT NULL COMMENT '插件使用场景API_PROTOCOL/PLATFORM' ,
PRIMARY KEY (id) PRIMARY KEY (id)
) ENGINE = InnoDB ) ENGINE = InnoDB
@ -352,7 +352,7 @@ CREATE TABLE IF NOT EXISTS custom_field(
`name` VARCHAR(255) NOT NULL COMMENT '自定义字段名称' , `name` VARCHAR(255) NOT NULL COMMENT '自定义字段名称' ,
`scene` VARCHAR(30) NOT NULL COMMENT '使用场景' , `scene` VARCHAR(30) NOT NULL COMMENT '使用场景' ,
`type` VARCHAR(30) NOT NULL COMMENT '自定义字段类型' , `type` VARCHAR(30) NOT NULL COMMENT '自定义字段类型' ,
`remark` VARCHAR(500) COMMENT '自定义字段备注' , `remark` VARCHAR(1000) COMMENT '自定义字段备注' ,
`internal` BIT NOT NULL DEFAULT 0 COMMENT '是否是内置字段' , `internal` BIT NOT NULL DEFAULT 0 COMMENT '是否是内置字段' ,
`scope_type` VARCHAR(50) NOT NULL DEFAULT 0 COMMENT '组织或项目级别字段PROJECT, ORGANIZATION' , `scope_type` VARCHAR(50) NOT NULL DEFAULT 0 COMMENT '组织或项目级别字段PROJECT, ORGANIZATION' ,
`create_time` BIGINT NOT NULL COMMENT '创建时间' , `create_time` BIGINT NOT NULL COMMENT '创建时间' ,

View File

@ -88,6 +88,7 @@ custom_field.scene.length_range=场景长度必须在{min}-{max}之间
custom_field.scene.not_blank=场景不能为空 custom_field.scene.not_blank=场景不能为空
custom_field.type.length_range=类型长度必须在{min}-{max}之间 custom_field.type.length_range=类型长度必须在{min}-{max}之间
custom_field.type.not_blank=类型不能为空 custom_field.type.not_blank=类型不能为空
custom_field.remark.length_range=描述长度必须在{max}以内
file_module_blob.file_module_id.not_blank=文件模块ID不能为空 file_module_blob.file_module_id.not_blank=文件模块ID不能为空
project_version.id.not_blank=ID不能为空 project_version.id.not_blank=ID不能为空
project_version.project_id.length_range=项目ID长度必须在{min}-{max}之间 project_version.project_id.length_range=项目ID长度必须在{min}-{max}之间

View File

@ -100,6 +100,7 @@ custom_field.scene.length_range=Scene length must be between {min} and {max}
custom_field.scene.not_blank=Scene is required custom_field.scene.not_blank=Scene is required
custom_field.type.length_range=Type length must be between {min} and {max} custom_field.type.length_range=Type length must be between {min} and {max}
custom_field.type.not_blank=Type is required custom_field.type.not_blank=Type is required
custom_field.remark.length_range=Remark length must be within {max}
file_module_blob.file_module_id.not_blank=File Module ID is required file_module_blob.file_module_id.not_blank=File Module ID is required
project_version.id.not_blank=ID is required project_version.id.not_blank=ID is required
project_version.project_id.length_range=Project ID length must be between {min} and {max} project_version.project_id.length_range=Project ID length must be between {min} and {max}

View File

@ -100,6 +100,7 @@ custom_field.scene.length_range=场景长度必须在{min}-{max}之间
custom_field.scene.not_blank=场景不能为空 custom_field.scene.not_blank=场景不能为空
custom_field.type.length_range=类型长度必须在{min}-{max}之间 custom_field.type.length_range=类型长度必须在{min}-{max}之间
custom_field.type.not_blank=类型不能为空 custom_field.type.not_blank=类型不能为空
custom_field.remark.length_range=描述长度必须在{max}以内
file_module_blob.file_module_id.not_blank=文件模块ID不能为空 file_module_blob.file_module_id.not_blank=文件模块ID不能为空
project_version.id.not_blank=ID不能为空 project_version.id.not_blank=ID不能为空
project_version.project_id.length_range=项目ID长度必须在{min}-{max}之间 project_version.project_id.length_range=项目ID长度必须在{min}-{max}之间

View File

@ -100,6 +100,7 @@ custom_field.scene.length_range=場景長度必須在{min}-{max}之間
custom_field.scene.not_blank=場景不能為空 custom_field.scene.not_blank=場景不能為空
custom_field.type.length_range=類型長度必須在{min}-{max}之間 custom_field.type.length_range=類型長度必須在{min}-{max}之間
custom_field.type.not_blank=類型不能為空 custom_field.type.not_blank=類型不能為空
custom_field.remark.length_range=描述長度必須在{max}之內
file_module_blob.file_module_id.not_blank=文件模塊ID不能為空 file_module_blob.file_module_id.not_blank=文件模塊ID不能為空
project_version.id.not_blank=ID不能為空 project_version.id.not_blank=ID不能為空
project_version.project_id.length_range=項目ID長度必須在{min}-{max}之間 project_version.project_id.length_range=項目ID長度必須在{min}-{max}之間

View File

@ -20,7 +20,7 @@ public class OrganizationEditRequest implements Serializable {
@Schema(description = "组织名称", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "组织名称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{organization.name.not_blank}", groups = {Created.class, Updated.class}) @NotBlank(message = "{organization.name.not_blank}", groups = {Created.class, Updated.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; private String name;
@Schema(description = "描述") @Schema(description = "描述")

View File

@ -22,6 +22,6 @@ public class OrganizationNameEditRequest implements Serializable {
@Schema(description = "组织名称", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "组织名称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{organization.name.not_blank}", groups = {Created.class, Updated.class}) @NotBlank(message = "{organization.name.not_blank}", groups = {Created.class, Updated.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; private String name;
} }

View File

@ -28,7 +28,7 @@ public class PluginUpdateRequest {
private Boolean global; private Boolean global;
@Schema(description = "插件描述") @Schema(description = "插件描述")
@Size(max = 500, message = "{plugin.scenario.length_range}", groups = {Created.class, Updated.class}) @Size(max = 1000, message = "{plugin.scenario.length_range}", groups = {Created.class, Updated.class})
private String description; private String description;
@Schema(hidden = true) @Schema(hidden = true)

View File

@ -38,6 +38,7 @@ public class CustomFieldUpdateRequest {
private String type; private String type;
@Schema(title = "自定义字段备注") @Schema(title = "自定义字段备注")
@Size(max = 1000, message = "{custom_field.remark.length_range}", groups = {Created.class, Updated.class})
private String remark; private String remark;
@Schema(title = "组织或项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "组织或项目ID", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -16,6 +16,6 @@ public class PluginUpdateRequestDefinition {
@Size(min = 1, max = 255, groups = {Created.class, Updated.class}) @Size(min = 1, max = 255, groups = {Created.class, Updated.class})
private String name; private String name;
@Size(max = 500, groups = {Created.class, Updated.class}) @Size(max = 1000, groups = {Created.class, Updated.class})
private String description; private String description;
} }