From 476bb47718f28781fdacab0f6d8ad882a67f2788 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Fri, 12 May 2023 16:31:13 +0800 Subject: [PATCH] build: swagger model --- .../project/domain/ApiTemplate.java | 77 ++++----- .../project/domain/CustomField.java | 110 ++++++------- .../project/domain/CustomFieldApi.java | 35 ++--- .../project/domain/CustomFieldIssue.java | 33 ++-- .../project/domain/CustomFieldTemplate.java | 77 ++++----- .../project/domain/CustomFieldTestCase.java | 35 ++--- .../project/domain/CustomFunction.java | 78 ++++----- .../project/domain/CustomFunctionBlob.java | 36 ++--- .../metersphere/project/domain/FakeError.java | 79 ++++------ .../project/domain/FakeErrorBlob.java | 26 ++- .../project/domain/FileMetadata.java | 148 +++++++----------- .../project/domain/FileMetadataBlob.java | 18 +-- .../project/domain/FileModule.java | 84 ++++------ .../project/domain/FileModuleBlob.java | 42 ++--- .../metersphere/project/domain/Project.java | 68 ++++---- .../project/domain/ProjectApplication.java | 27 ++-- .../project/domain/ProjectExtend.java | 99 +++++------- .../project/domain/ProjectVersion.java | 94 +++++------ .../metersphere/sdk/domain/Environment.java | 116 ++++++-------- .../sdk/domain/EnvironmentGroup.java | 60 +++---- .../sdk/domain/EnvironmentGroupProject.java | 36 ++--- .../sdk/domain/ExecutionQueue.java | 60 +++---- .../sdk/domain/ExecutionQueueDetail.java | 92 +++++------ .../sdk/domain/RelationshipEdge.java | 52 +++--- .../io/metersphere/sdk/domain/ShareInfo.java | 60 +++---- .../metersphere/system/domain/AuthSource.java | 67 ++++---- .../io/metersphere/system/domain/License.java | 34 ++-- .../system/domain/MessageTask.java | 80 +++++----- .../system/domain/MessageTaskBlob.java | 18 +-- .../system/domain/Notification.java | 99 ++++++------ .../system/domain/NoviceStatistics.java | 59 +++---- .../system/domain/OperatingLog.java | 107 +++++-------- .../system/domain/OperatingLogResource.java | 19 +-- .../io/metersphere/system/domain/Plugin.java | 121 ++++++-------- .../metersphere/system/domain/PluginBlob.java | 26 ++- .../io/metersphere/system/domain/Quota.java | 114 ++++++-------- .../metersphere/system/domain/Schedule.java | 110 ++++++------- .../system/domain/ServiceIntegration.java | 35 ++--- .../system/domain/SystemParameter.java | 27 ++-- .../system/domain/TestResource.java | 52 +++--- .../system/domain/TestResourcePool.java | 109 ++++++------- .../io/metersphere/system/domain/User.java | 111 ++++++------- .../metersphere/system/domain/UserExtend.java | 28 ++-- .../io/metersphere/system/domain/UserKey.java | 53 +++---- .../metersphere/system/domain/UserRole.java | 79 ++++------ .../system/domain/UserRolePermission.java | 36 ++--- .../system/domain/UserRoleRelation.java | 53 +++---- .../metersphere/system/domain/Workspace.java | 52 +++--- 48 files changed, 1287 insertions(+), 1844 deletions(-) diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ApiTemplate.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ApiTemplate.java index b766700908..3086e38a62 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ApiTemplate.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ApiTemplate.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "API模版表") @@ -16,60 +17,46 @@ import java.io.Serializable; @Data public class ApiTemplate implements Serializable { private static final long serialVersionUID = 1L; - - /** 模版ID */ + @TableId - @NotBlank(message = "模版ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "模版ID") + @NotBlank(message = "{api_template.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "模版ID", required = true, allowableValues = "range[1, 100]") private String id; - - /** 模版名称 */ - @Size(min = 1, max = 64, message = "模版名称长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "模版名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "模版名称") + + @Size(min = 1, max = 64, message = "{api_template.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{api_template.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "模版名称", required = true, allowableValues = "range[1, 64]") private String name; - - /** 描述 */ - - - @ApiModelProperty(name = "描述") + + + @ApiModelProperty(name = "描述", required = false, allowableValues = "range[1, 255]") private String description; - - /** 是否是系统模版 */ - @Size(min = 1, max = 1, message = "是否是系统模版长度必须在1-1之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "是否是系统模版不能为空", groups = {Created.class}) - @ApiModelProperty(name = "是否是系统模版") + + @Size(min = 1, max = 1, message = "{api_template.system.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{api_template.system.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "是否是系统模版", required = true, allowableValues = "range[1, 1]") private Boolean system; - - /** 是否是全局模版 */ - @Size(min = 1, max = 1, message = "是否是全局模版长度必须在1-1之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "是否是全局模版不能为空", groups = {Created.class}) - @ApiModelProperty(name = "是否是全局模版") + + @Size(min = 1, max = 1, message = "{api_template.global.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{api_template.global.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "是否是全局模版", required = true, allowableValues = "range[1, 1]") private Boolean global; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 100]") private String createUser; - - /** 项目ID */ - - - @ApiModelProperty(name = "项目ID") + + + @ApiModelProperty(name = "项目ID", required = false, allowableValues = "range[1, 64]") private String projectId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomField.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomField.java index 001fb28fb6..ec00a402b5 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomField.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomField.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "自定义字段") @@ -16,84 +17,63 @@ import java.io.Serializable; @Data public class CustomField implements Serializable { private static final long serialVersionUID = 1L; - - /** 自定义字段ID */ + @TableId - @NotBlank(message = "自定义字段ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "自定义字段ID") + @NotBlank(message = "{custom_field.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "自定义字段ID", required = true, allowableValues = "range[1, 100]") private String id; - - /** 自定义字段名称 */ - @Size(min = 1, max = 64, message = "自定义字段名称长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "自定义字段名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "自定义字段名称") + + @Size(min = 1, max = 64, message = "{custom_field.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_field.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "自定义字段名称", required = true, allowableValues = "range[1, 64]") private String name; - - /** 使用场景 */ - @Size(min = 1, max = 30, message = "使用场景长度必须在1-30之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "使用场景不能为空", groups = {Created.class}) - @ApiModelProperty(name = "使用场景") + + @Size(min = 1, max = 30, message = "{custom_field.scene.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_field.scene.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "使用场景", required = true, allowableValues = "range[1, 30]") private String scene; - - /** 自定义字段类型 */ - @Size(min = 1, max = 30, message = "自定义字段类型长度必须在1-30之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "自定义字段类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "自定义字段类型") + + @Size(min = 1, max = 30, message = "{custom_field.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_field.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "自定义字段类型", required = true, allowableValues = "range[1, 30]") private String type; - - /** 自定义字段备注 */ - - - @ApiModelProperty(name = "自定义字段备注") + + + @ApiModelProperty(name = "自定义字段备注", required = false, allowableValues = "range[1, 255]") private String remark; - - /** 自定义字段选项 */ - - - @ApiModelProperty(name = "自定义字段选项") + + + @ApiModelProperty(name = "自定义字段选项", required = false, allowableValues = "range[1, ]") private String options; - - /** 是否是系统字段 */ - - - @ApiModelProperty(name = "是否是系统字段") + + + @ApiModelProperty(name = "是否是系统字段", required = false, allowableValues = "range[1, 1]") private Boolean system; - - /** 是否是全局字段 */ - - - @ApiModelProperty(name = "是否是全局字段") + + + @ApiModelProperty(name = "是否是全局字段", required = false, allowableValues = "range[1, 1]") private Boolean global; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 100]") private String createUser; - - /** 项目ID */ - - - @ApiModelProperty(name = "项目ID") + + + @ApiModelProperty(name = "项目ID", required = false, allowableValues = "range[1, 64]") private String projectId; - - /** 是否关联第三方 */ - @Size(min = 1, max = 1, message = "是否关联第三方长度必须在1-1之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "是否关联第三方不能为空", groups = {Created.class}) - @ApiModelProperty(name = "是否关联第三方") + + @Size(min = 1, max = 1, message = "{custom_field.third_part.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_field.third_part.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "是否关联第三方", required = true, allowableValues = "range[1, 1]") private Boolean thirdPart; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldApi.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldApi.java index eebd223861..a00cdfdb84 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldApi.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldApi.java @@ -2,13 +2,12 @@ package io.metersphere.project.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "自定义字段关系") @@ -16,30 +15,24 @@ import java.io.Serializable; @Data public class CustomFieldApi implements Serializable { private static final long serialVersionUID = 1L; - - /** 资源ID */ + @TableId - @NotBlank(message = "资源ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "资源ID") + @NotBlank(message = "{custom_field_api.resource_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "资源ID", required = true, allowableValues = "range[1, 50]") private String resourceId; - - /** 字段ID */ + @TableId - @NotBlank(message = "字段ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "字段ID") + @NotBlank(message = "{custom_field_api.field_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "字段ID", required = true, allowableValues = "range[1, 50]") private String fieldId; - - /** 字段值 */ - - - @ApiModelProperty(name = "字段值") + + + @ApiModelProperty(name = "字段值", required = false, allowableValues = "range[1, 500]") private String value; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private byte[] textValue; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldIssue.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldIssue.java index a781ef55db..31aed8e2dc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldIssue.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldIssue.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "自定义字段缺陷关系") @@ -16,30 +17,24 @@ import java.io.Serializable; @Data public class CustomFieldIssue implements Serializable { private static final long serialVersionUID = 1L; - - /** 资源ID */ + @TableId - @NotBlank(message = "资源ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "资源ID") + @NotBlank(message = "{custom_field_issue.resource_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "资源ID", required = true, allowableValues = "range[1, 50]") private String resourceId; - - /** 字段ID */ + @TableId - @NotBlank(message = "字段ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "字段ID") + @NotBlank(message = "{custom_field_issue.field_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "字段ID", required = true, allowableValues = "range[1, 50]") private String fieldId; - - /** 字段值 */ - - - @ApiModelProperty(name = "字段值") + + + @ApiModelProperty(name = "字段值", required = false, allowableValues = "range[1, 1000]") private String value; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private byte[] textValue; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTemplate.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTemplate.java index 7f169e9fdd..ef4001e04f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTemplate.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTemplate.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "自定义模版") @@ -16,60 +17,46 @@ import java.io.Serializable; @Data public class CustomFieldTemplate implements Serializable { private static final long serialVersionUID = 1L; - - /** 自定义模版ID */ + @TableId - @NotBlank(message = "自定义模版ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "自定义模版ID") + @NotBlank(message = "{custom_field_template.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "自定义模版ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 自定义字段ID */ - @Size(min = 1, max = 50, message = "自定义字段ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "自定义字段ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "自定义字段ID") + + @Size(min = 1, max = 50, message = "{custom_field_template.field_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_field_template.field_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "自定义字段ID", required = true, allowableValues = "range[1, 50]") private String fieldId; - - /** 模版ID */ - @Size(min = 1, max = 50, message = "模版ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "模版ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "模版ID") + + @Size(min = 1, max = 50, message = "{custom_field_template.template_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_field_template.template_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "模版ID", required = true, allowableValues = "range[1, 50]") private String templateId; - - /** 使用场景 */ - @Size(min = 1, max = 30, message = "使用场景长度必须在1-30之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "使用场景不能为空", groups = {Created.class}) - @ApiModelProperty(name = "使用场景") + + @Size(min = 1, max = 30, message = "{custom_field_template.scene.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_field_template.scene.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "使用场景", required = true, allowableValues = "range[1, 30]") private String scene; - - /** 是否必填 */ - - - @ApiModelProperty(name = "是否必填") + + + @ApiModelProperty(name = "是否必填", required = false, allowableValues = "range[1, 1]") private Boolean required; - - /** 排序字段 */ - - - @ApiModelProperty(name = "排序字段") + + + @ApiModelProperty(name = "排序字段", required = false, allowableValues = "range[1, ]") private Integer pos; - - /** 默认值 */ - - - @ApiModelProperty(name = "默认值") + + + @ApiModelProperty(name = "默认值", required = false, allowableValues = "range[1, ]") private byte[] defaultValue; - - /** 自定义数据 */ - - - @ApiModelProperty(name = "自定义数据") + + + @ApiModelProperty(name = "自定义数据", required = false, allowableValues = "range[1, 255]") private String customData; - - /** 自定义表头 */ - - - @ApiModelProperty(name = "自定义表头") + + + @ApiModelProperty(name = "自定义表头", required = false, allowableValues = "range[1, 1]") private String key; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTestCase.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTestCase.java index 187143a94f..110596f676 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTestCase.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTestCase.java @@ -2,13 +2,12 @@ package io.metersphere.project.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "自定义字段功能用例关系") @@ -16,30 +15,24 @@ import java.io.Serializable; @Data public class CustomFieldTestCase implements Serializable { private static final long serialVersionUID = 1L; - - /** 资源ID */ + @TableId - @NotBlank(message = "资源ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "资源ID") + @NotBlank(message = "{custom_field_test_case.resource_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "资源ID", required = true, allowableValues = "range[1, 50]") private String resourceId; - - /** 字段ID */ + @TableId - @NotBlank(message = "字段ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "字段ID") + @NotBlank(message = "{custom_field_test_case.field_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "字段ID", required = true, allowableValues = "range[1, 50]") private String fieldId; - - /** 字段值 */ - - - @ApiModelProperty(name = "字段值") + + + @ApiModelProperty(name = "字段值", required = false, allowableValues = "range[1, 1000]") private String value; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private String textValue; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunction.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunction.java index e1d53d15d3..68284811ec 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunction.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunction.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "自定义函数-代码片段") @@ -16,60 +17,47 @@ import java.io.Serializable; @Data public class CustomFunction implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{custom_function.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 50]") private String id; - - /** 函数名 */ - @Size(min = 1, max = 255, message = "函数名长度必须在1-255之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "函数名不能为空", groups = {Created.class}) - @ApiModelProperty(name = "函数名") + + @Size(min = 1, max = 255, message = "{custom_function.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_function.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "函数名", required = true, allowableValues = "range[1, 255]") private String name; - - /** 标签 */ - - - @ApiModelProperty(name = "标签") + + + @ApiModelProperty(name = "标签", required = false, allowableValues = "range[1, 1000]") private String tags; - - /** 函数描述 */ - - - @ApiModelProperty(name = "函数描述") + + + @ApiModelProperty(name = "函数描述", required = false, allowableValues = "range[1, 1000]") private String description; - - /** 脚本语言类型 */ - @Size(min = 1, max = 255, message = "脚本语言类型长度必须在1-255之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "脚本语言类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "脚本语言类型") + + @Size(min = 1, max = 255, message = "{custom_function.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_function.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "脚本语言类型", required = true, allowableValues = "range[1, 255]") private String type; - - /** 创建人 */ - @Size(min = 1, max = 100, message = "创建人长度必须在1-100之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "创建人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "创建人") + + @Size(min = 1, max = 100, message = "{custom_function.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_function.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "创建人", required = true, allowableValues = "range[1, 100]") private String createUser; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 所属项目ID */ - @Size(min = 1, max = 50, message = "所属项目ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "所属项目ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "所属项目ID") + + @Size(min = 1, max = 50, message = "{custom_function.project_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{custom_function.project_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "所属项目ID", required = true, allowableValues = "range[1, 50]") private String projectId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunctionBlob.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunctionBlob.java index 58393812e0..0c529c3f65 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunctionBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunctionBlob.java @@ -2,13 +2,12 @@ package io.metersphere.project.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "自定义函数-代码片段大字段") @@ -16,30 +15,23 @@ import java.io.Serializable; @Data public class CustomFunctionBlob implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{custom_function_blob.function_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 50]") private String functionId; - - /** 参数列表 */ - - - @ApiModelProperty(name = "参数列表") + + + @ApiModelProperty(name = "参数列表", required = false, allowableValues = "range[1, ]") private byte[] params; - - /** 函数体 */ - - - @ApiModelProperty(name = "函数体") + + + @ApiModelProperty(name = "函数体", required = false, allowableValues = "range[1, ]") private byte[] script; - - /** 执行结果 */ - - - @ApiModelProperty(name = "执行结果") + + + @ApiModelProperty(name = "执行结果", required = false, allowableValues = "range[1, ]") private byte[] result; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeError.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeError.java index 58c7f0aecd..ebc92dce2c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeError.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeError.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "误报库") @@ -16,60 +17,48 @@ import java.io.Serializable; @Data public class FakeError implements Serializable { private static final long serialVersionUID = 1L; - - /** 误报ID */ + @TableId - @NotBlank(message = "误报ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "误报ID") + @NotBlank(message = "{fake_error.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "误报ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 项目ID */ - @Size(min = 1, max = 50, message = "项目ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "项目ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "项目ID") + + @Size(min = 1, max = 50, message = "{fake_error.project_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{fake_error.project_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "项目ID", required = true, allowableValues = "range[1, 50]") private String projectId; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 创建人 */ - @Size(min = 1, max = 64, message = "创建人长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "创建人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "创建人") + + @Size(min = 1, max = 64, message = "{fake_error.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{fake_error.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "创建人", required = true, allowableValues = "range[1, 64]") private String createUser; - - /** 更新人 */ - @Size(min = 1, max = 64, message = "更新人长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "更新人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "更新人") + + @Size(min = 1, max = 64, message = "{fake_error.update_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{fake_error.update_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "更新人", required = true, allowableValues = "range[1, 64]") private String updateUser; - - /** 错误码 */ - @Size(min = 1, max = 255, message = "错误码长度必须在1-255之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "错误码不能为空", groups = {Created.class}) - @ApiModelProperty(name = "错误码") + + @Size(min = 1, max = 255, message = "{fake_error.error_code.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{fake_error.error_code.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "错误码", required = true, allowableValues = "range[1, 255]") private String errorCode; - - /** 匹配类型 */ - @Size(min = 1, max = 255, message = "匹配类型长度必须在1-255之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "匹配类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "匹配类型") + + @Size(min = 1, max = 255, message = "{fake_error.match_type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{fake_error.match_type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "匹配类型", required = true, allowableValues = "range[1, 255]") private String matchType; - - /** 状态 */ - - - @ApiModelProperty(name = "状态") + + + @ApiModelProperty(name = "状态", required = false, allowableValues = "range[1, 1]") private Boolean status; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeErrorBlob.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeErrorBlob.java index 1b4b331a8b..53edc7973e 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeErrorBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeErrorBlob.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "误报库大字段") @@ -16,24 +17,19 @@ import java.io.Serializable; @Data public class FakeErrorBlob implements Serializable { private static final long serialVersionUID = 1L; - - /** Test ID */ + @TableId - @NotBlank(message = "Test ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "Test ID") + @NotBlank(message = "{fake_error_blob.fake_error_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "Test ID", required = true, allowableValues = "range[1, 50]") private String fakeErrorId; - - /** 内容 */ - - - @ApiModelProperty(name = "内容") + + + @ApiModelProperty(name = "内容", required = false, allowableValues = "range[1, ]") private byte[] content; - - /** 报告内容 */ - - - @ApiModelProperty(name = "报告内容") + + + @ApiModelProperty(name = "报告内容", required = false, allowableValues = "range[1, ]") private byte[] description; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadata.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadata.java index 196217f8a6..758fa1dccc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadata.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadata.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "文件基础信息") @@ -16,114 +17,81 @@ import java.io.Serializable; @Data public class FileMetadata implements Serializable { private static final long serialVersionUID = 1L; - - /** 文件ID */ + @TableId - @NotBlank(message = "文件ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "文件ID") + @NotBlank(message = "{file_metadata.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "文件ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 文件名 */ - @Size(min = 1, max = 250, message = "文件名长度必须在1-250之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "文件名不能为空", groups = {Created.class}) - @ApiModelProperty(name = "文件名") + + @Size(min = 1, max = 250, message = "{file_metadata.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{file_metadata.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "文件名", required = true, allowableValues = "range[1, 250]") private String name; - - /** 文件类型 */ - - - @ApiModelProperty(name = "文件类型") + + + @ApiModelProperty(name = "文件类型", required = false, allowableValues = "range[1, 64]") private String type; - - /** 文件大小 */ - - - @ApiModelProperty(name = "文件大小") + + + @ApiModelProperty(name = "文件大小", required = true, allowableValues = "range[1, ]") private Long size; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 项目ID */ - - - @ApiModelProperty(name = "项目ID") + + + @ApiModelProperty(name = "项目ID", required = false, allowableValues = "range[1, 50]") private String projectId; - - /** 文件存储方式 */ - @Size(min = 1, max = 50, message = "文件存储方式长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "文件存储方式不能为空", groups = {Created.class}) - @ApiModelProperty(name = "文件存储方式") + + @Size(min = 1, max = 50, message = "{file_metadata.storage.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{file_metadata.storage.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "文件存储方式", required = true, allowableValues = "range[1, 50]") private String storage; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 100]") private String createUser; - - /** 修改人 */ - - - @ApiModelProperty(name = "修改人") + + + @ApiModelProperty(name = "修改人", required = false, allowableValues = "range[1, 100]") private String updateUser; - - /** 标签 */ - - - @ApiModelProperty(name = "标签") + + + @ApiModelProperty(name = "标签", required = false, allowableValues = "range[1, 2000]") private String tags; - - /** 描述 */ - - - @ApiModelProperty(name = "描述") + + + @ApiModelProperty(name = "描述", required = false, allowableValues = "range[1, 255]") private String description; - - /** 文件所属模块 */ - - - @ApiModelProperty(name = "文件所属模块") + + + @ApiModelProperty(name = "文件所属模块", required = false, allowableValues = "range[1, 50]") private String moduleId; - - /** 是否加载jar(开启后用于接口测试执行时使用) */ - - - @ApiModelProperty(name = "是否加载jar(开启后用于接口测试执行时使用)") + + + @ApiModelProperty(name = "是否加载jar(开启后用于接口测试执行时使用)", required = false, allowableValues = "range[1, 1]") private Boolean loadJar; - - /** 文件存储路径 */ - - - @ApiModelProperty(name = "文件存储路径") + + + @ApiModelProperty(name = "文件存储路径", required = false, allowableValues = "range[1, 1000]") private String path; - - /** 资源作用范围,主要兼容2.1版本前的历史数据,后续版本不再产生数据 */ - - - @ApiModelProperty(name = "资源作用范围,主要兼容2.1版本前的历史数据,后续版本不再产生数据") + + + @ApiModelProperty(name = "资源作用范围,主要兼容2.1版本前的历史数据,后续版本不再产生数据", required = false, allowableValues = "range[1, 50]") private String resourceType; - - /** 是否是最新版 */ - - - @ApiModelProperty(name = "是否是最新版") + + + @ApiModelProperty(name = "是否是最新版", required = false, allowableValues = "range[1, 1]") private Boolean latest; - - /** 同版本数据关联的ID */ - - - @ApiModelProperty(name = "同版本数据关联的ID") + + + @ApiModelProperty(name = "同版本数据关联的ID", required = false, allowableValues = "range[1, 50]") private String refId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataBlob.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataBlob.java index c43ae6dc3c..87272ed3b1 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataBlob.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "文件基础信息大字段") @@ -16,18 +17,15 @@ import java.io.Serializable; @Data public class FileMetadataBlob implements Serializable { private static final long serialVersionUID = 1L; - - /** 文件ID */ + @TableId - @NotBlank(message = "文件ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "文件ID") + @NotBlank(message = "{file_metadata_blob.file_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "文件ID", required = true, allowableValues = "range[1, 255]") private String fileId; - - /** 储存库 */ - - - @ApiModelProperty(name = "储存库") + + + @ApiModelProperty(name = "储存库", required = false, allowableValues = "range[1, ]") private byte[] gitInfo; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java index ded92c06e0..9ddcffc68a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "文件管理模块") @@ -16,66 +17,49 @@ import java.io.Serializable; @Data public class FileModule implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{file_module.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 项目ID */ - @Size(min = 1, max = 50, message = "项目ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "项目ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "项目ID") + + @Size(min = 1, max = 50, message = "{file_module.project_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{file_module.project_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "项目ID", required = true, allowableValues = "range[1, 50]") private String projectId; - - /** 模块名称 */ - @Size(min = 1, max = 64, message = "模块名称长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "模块名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "模块名称") + + @Size(min = 1, max = 64, message = "{file_module.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{file_module.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "模块名称", required = true, allowableValues = "range[1, 64]") private String name; - - /** 父级ID */ - - - @ApiModelProperty(name = "父级ID") + + + @ApiModelProperty(name = "父级ID", required = false, allowableValues = "range[1, 50]") private String parentId; - - /** 层数 */ - - - @ApiModelProperty(name = "层数") + + + @ApiModelProperty(name = "层数", required = false, allowableValues = "range[1, ]") private Integer level; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 排序用的标识 */ - - - @ApiModelProperty(name = "排序用的标识") + + + @ApiModelProperty(name = "排序用的标识", required = false, allowableValues = "range[1, 22]") private Double pos; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 100]") private String createUser; - - /** 模块类型: module/repository */ - - - @ApiModelProperty(name = "模块类型: module/repository") + + + @ApiModelProperty(name = "模块类型: module/repository", required = false, allowableValues = "range[1, 20]") private String moduleType; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleBlob.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleBlob.java index c1e1113dde..31535767bc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleBlob.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "文件管理模块大字段") @@ -16,36 +17,27 @@ import java.io.Serializable; @Data public class FileModuleBlob implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{file_module_blob.file_module_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, 50]") private String fileModuleId; - - /** 存储库描述 */ - - - @ApiModelProperty(name = "存储库描述") + + + @ApiModelProperty(name = "存储库描述", required = false, allowableValues = "range[1, ]") private byte[] repositoryDesc; - - /** 存储库路径 */ - - - @ApiModelProperty(name = "存储库路径") + + + @ApiModelProperty(name = "存储库路径", required = false, allowableValues = "range[1, 255]") private String repositoryPath; - - /** 存储库Token */ - - - @ApiModelProperty(name = "存储库Token") + + + @ApiModelProperty(name = "存储库Token", required = false, allowableValues = "range[1, 255]") private String repositoryUserName; - - /** 存储库Token */ - - - @ApiModelProperty(name = "存储库Token") + + + @ApiModelProperty(name = "存储库Token", required = false, allowableValues = "range[1, 255]") private String repositoryToken; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/Project.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/Project.java index 5bed913a25..e94641f615 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/Project.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/Project.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "项目") @@ -16,54 +17,41 @@ import java.io.Serializable; @Data public class Project implements Serializable { private static final long serialVersionUID = 1L; - - /** 项目ID */ + @TableId - @NotBlank(message = "项目ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "项目ID") + @NotBlank(message = "{project.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "项目ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 工作空间ID */ - @Size(min = 1, max = 50, message = "工作空间ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "工作空间ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "工作空间ID") + + @Size(min = 1, max = 50, message = "{project.workspace_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{project.workspace_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "工作空间ID", required = true, allowableValues = "range[1, 50]") private String workspaceId; - - /** 项目名称 */ - @Size(min = 1, max = 64, message = "项目名称长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "项目名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "项目名称") + + @Size(min = 1, max = 64, message = "{project.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{project.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "项目名称", required = true, allowableValues = "range[1, 64]") private String name; - - /** 项目描述 */ - - - @ApiModelProperty(name = "项目描述") + + + @ApiModelProperty(name = "项目描述", required = false, allowableValues = "range[1, 255]") private String description; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 100]") private String createUser; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 50]") private String systemId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectApplication.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectApplication.java index e565660a6f..867c31714d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectApplication.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectApplication.java @@ -2,13 +2,12 @@ package io.metersphere.project.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "项目应用") @@ -16,24 +15,20 @@ import java.io.Serializable; @Data public class ProjectApplication implements Serializable { private static final long serialVersionUID = 1L; - - /** 项目ID */ + @TableId - @NotBlank(message = "项目ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "项目ID") + @NotBlank(message = "{project_application.project_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "项目ID", required = true, allowableValues = "range[1, 50]") private String projectId; - - /** 配置项 */ + @TableId - @NotBlank(message = "配置项不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "配置项") + @NotBlank(message = "{project_application.type.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "配置项", required = true, allowableValues = "range[1, 50]") private String type; - - /** 配置值 */ - - - @ApiModelProperty(name = "配置值") + + + @ApiModelProperty(name = "配置值", required = false, allowableValues = "range[1, 255]") private String typeValue; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectExtend.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectExtend.java index 4614dc3293..dcec9fb23f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectExtend.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectExtend.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "项目扩展") @@ -16,78 +17,56 @@ import java.io.Serializable; @Data public class ProjectExtend implements Serializable { private static final long serialVersionUID = 1L; - - /** 项目ID */ + @TableId - @NotBlank(message = "项目ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "项目ID") + @NotBlank(message = "{project_extend.project_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "项目ID", required = true, allowableValues = "range[1, 50]") private String projectId; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 50]") private String tapdId; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 50]") private String jiraKey; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 50]") private String zentaoId; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 50]") private String azureDevopsId; - - /** 用例模版ID */ - - - @ApiModelProperty(name = "用例模版ID") + + + @ApiModelProperty(name = "用例模版ID", required = false, allowableValues = "range[1, 50]") private String caseTemplateId; - - /** azure 过滤需求的 parent workItem ID */ - - - @ApiModelProperty(name = "azure 过滤需求的 parent workItem ID") + + + @ApiModelProperty(name = "azure 过滤需求的 parent workItem ID", required = false, allowableValues = "range[1, 50]") private String azureFilterId; - - /** 项目使用哪个平台的模板 */ - @Size(min = 1, max = 20, message = "项目使用哪个平台的模板长度必须在1-20之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "项目使用哪个平台的模板不能为空", groups = {Created.class}) - @ApiModelProperty(name = "项目使用哪个平台的模板") + + @Size(min = 1, max = 20, message = "{project_extend.platform.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{project_extend.platform.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "项目使用哪个平台的模板", required = true, allowableValues = "range[1, 20]") private String platform; - - /** 是否使用第三方平台缺陷模板 */ - - - @ApiModelProperty(name = "是否使用第三方平台缺陷模板") + + + @ApiModelProperty(name = "是否使用第三方平台缺陷模板", required = false, allowableValues = "range[1, 1]") private Boolean thirdPartTemplate; - - /** 是否开启版本管理 */ - - - @ApiModelProperty(name = "是否开启版本管理") + + + @ApiModelProperty(name = "是否开启版本管理", required = false, allowableValues = "range[1, 1]") private Boolean versionEnable; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private byte[] issueConfig; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 64]") private String apiTemplateId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectVersion.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectVersion.java index fda532da3b..3838ddc494 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectVersion.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectVersion.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "版本管理") @@ -16,72 +17,55 @@ import java.io.Serializable; @Data public class ProjectVersion implements Serializable { private static final long serialVersionUID = 1L; - - /** 版本ID */ + @TableId - @NotBlank(message = "版本ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "版本ID") + @NotBlank(message = "{project_version.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "版本ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 项目ID */ - @Size(min = 1, max = 50, message = "项目ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "项目ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "项目ID") + + @Size(min = 1, max = 50, message = "{project_version.project_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{project_version.project_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "项目ID", required = true, allowableValues = "range[1, 50]") private String projectId; - - /** 版本名称 */ - @Size(min = 1, max = 100, message = "版本名称长度必须在1-100之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "版本名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "版本名称") + + @Size(min = 1, max = 100, message = "{project_version.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{project_version.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "版本名称", required = true, allowableValues = "range[1, 100]") private String name; - - /** 描述 */ - - - @ApiModelProperty(name = "描述") + + + @ApiModelProperty(name = "描述", required = false, allowableValues = "range[1, 200]") private String description; - - /** 状态 */ - - - @ApiModelProperty(name = "状态") + + + @ApiModelProperty(name = "状态", required = false, allowableValues = "range[1, 20]") private String status; - - /** 是否是最新版 */ - @Size(min = 1, max = 1, message = "是否是最新版长度必须在1-1之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "是否是最新版不能为空", groups = {Created.class}) - @ApiModelProperty(name = "是否是最新版") + + @Size(min = 1, max = 1, message = "{project_version.latest.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{project_version.latest.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "是否是最新版", required = true, allowableValues = "range[1, 1]") private Boolean latest; - - /** 发布时间 */ - - - @ApiModelProperty(name = "发布时间") + + + @ApiModelProperty(name = "发布时间", required = false, allowableValues = "range[1, ]") private Long publishTime; - - /** 开始时间 */ - - - @ApiModelProperty(name = "开始时间") + + + @ApiModelProperty(name = "开始时间", required = false, allowableValues = "range[1, ]") private Long startTime; - - /** 结束时间 */ - - - @ApiModelProperty(name = "结束时间") + + + @ApiModelProperty(name = "结束时间", required = false, allowableValues = "range[1, ]") private Long endTime; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 创建人 */ - @Size(min = 1, max = 100, message = "创建人长度必须在1-100之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "创建人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "创建人") + + @Size(min = 1, max = 100, message = "{project_version.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{project_version.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "创建人", required = true, allowableValues = "range[1, 100]") private String createUser; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/Environment.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/Environment.java index 8d1995b2c4..42a814207f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/Environment.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/Environment.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "环境") @@ -16,90 +17,65 @@ import java.io.Serializable; @Data public class Environment implements Serializable { private static final long serialVersionUID = 1L; - - /** Api Test Environment ID */ + @TableId - @NotBlank(message = "Api Test Environment ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "Api Test Environment ID") + @NotBlank(message = "{environment.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "Api Test Environment ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** Api Test Environment Name */ - @Size(min = 1, max = 64, message = "Api Test Environment Name长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Api Test Environment Name不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Api Test Environment Name") + + @Size(min = 1, max = 64, message = "{environment.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{environment.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Api Test Environment Name", required = true, allowableValues = "range[1, 64]") private String name; - - /** Project ID */ - @Size(min = 1, max = 50, message = "Project ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Project ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Project ID") + + @Size(min = 1, max = 50, message = "{environment.project_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{environment.project_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Project ID", required = true, allowableValues = "range[1, 50]") private String projectId; - - /** Api Test Protocol */ - - - @ApiModelProperty(name = "Api Test Protocol") + + + @ApiModelProperty(name = "Api Test Protocol", required = false, allowableValues = "range[1, 20]") private String protocol; - - /** Api Test Socket */ - - - @ApiModelProperty(name = "Api Test Socket") + + + @ApiModelProperty(name = "Api Test Socket", required = false, allowableValues = "range[1, 225]") private String socket; - - /** Api Test Domain */ - - - @ApiModelProperty(name = "Api Test Domain") + + + @ApiModelProperty(name = "Api Test Domain", required = false, allowableValues = "range[1, 225]") private String domain; - - /** Api Test Port */ - - - @ApiModelProperty(name = "Api Test Port") + + + @ApiModelProperty(name = "Api Test Port", required = false, allowableValues = "range[1, ]") private Integer port; - - /** Global ariables */ - - - @ApiModelProperty(name = "Global ariables") + + + @ApiModelProperty(name = "Global ariables", required = false, allowableValues = "range[1, ]") private String variables; - - /** Global Heards */ - - - @ApiModelProperty(name = "Global Heards") + + + @ApiModelProperty(name = "Global Heards", required = false, allowableValues = "range[1, ]") private String headers; - - /** Config Data (JSON format) */ - - - @ApiModelProperty(name = "Config Data (JSON format)") + + + @ApiModelProperty(name = "Config Data (JSON format)", required = false, allowableValues = "range[1, ]") private String config; - - /** hosts */ - - - @ApiModelProperty(name = "hosts") + + + @ApiModelProperty(name = "hosts", required = false, allowableValues = "range[1, ]") private String hosts; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 100]") private String createUser; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private Long createTime; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private Long updateTime; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroup.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroup.java index 6991d69031..93bf368bb4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroup.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroup.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "环境组") @@ -16,48 +17,37 @@ import java.io.Serializable; @Data public class EnvironmentGroup implements Serializable { private static final long serialVersionUID = 1L; - - /** 环境组id */ + @TableId - @NotBlank(message = "环境组id不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "环境组id") + @NotBlank(message = "{environment_group.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "环境组id", required = true, allowableValues = "range[1, 50]") private String id; - - /** 环境组名 */ - @Size(min = 1, max = 50, message = "环境组名长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "环境组名不能为空", groups = {Created.class}) - @ApiModelProperty(name = "环境组名") + + @Size(min = 1, max = 50, message = "{environment_group.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{environment_group.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "环境组名", required = true, allowableValues = "range[1, 50]") private String name; - - /** 所属工作空间 */ - @Size(min = 1, max = 64, message = "所属工作空间长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "所属工作空间不能为空", groups = {Created.class}) - @ApiModelProperty(name = "所属工作空间") + + @Size(min = 1, max = 64, message = "{environment_group.workspace_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{environment_group.workspace_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "所属工作空间", required = true, allowableValues = "range[1, 64]") private String workspaceId; - - /** 环境组描述 */ - - - @ApiModelProperty(name = "环境组描述") + + + @ApiModelProperty(name = "环境组描述", required = false, allowableValues = "range[1, 255]") private String description; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 50]") private String createUser; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = false, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = false, allowableValues = "range[1, ]") private Long updateTime; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProject.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProject.java index 57692d5046..a4a388d3aa 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProject.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/EnvironmentGroupProject.java @@ -2,13 +2,12 @@ package io.metersphere.sdk.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "环境组配置") @@ -16,30 +15,23 @@ import java.io.Serializable; @Data public class EnvironmentGroupProject implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{environment_group_project.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 50]") private String id; - - /** 环境组id */ - - - @ApiModelProperty(name = "环境组id") + + + @ApiModelProperty(name = "环境组id", required = false, allowableValues = "range[1, 50]") private String environmentGroupId; - - /** api test environment 环境ID */ - - - @ApiModelProperty(name = "api test environment 环境ID") + + + @ApiModelProperty(name = "api test environment 环境ID", required = false, allowableValues = "range[1, 50]") private String environmentId; - - /** 项目id */ - - - @ApiModelProperty(name = "项目id") + + + @ApiModelProperty(name = "项目id", required = false, allowableValues = "range[1, 50]") private String projectId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ExecutionQueue.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ExecutionQueue.java index 541c9bb558..a5dcb76f8a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ExecutionQueue.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ExecutionQueue.java @@ -2,13 +2,12 @@ package io.metersphere.sdk.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "执行链(接口/场景/UI/性能用例)") @@ -16,48 +15,35 @@ import java.io.Serializable; @Data public class ExecutionQueue implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{execution_queue.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 集合报告/测试计划报告 */ - - - @ApiModelProperty(name = "集合报告/测试计划报告") + + + @ApiModelProperty(name = "集合报告/测试计划报告", required = false, allowableValues = "range[1, 100]") private String reportId; - - /** 报告类型/计划报告/单独报告 */ - - - @ApiModelProperty(name = "报告类型/计划报告/单独报告") + + + @ApiModelProperty(name = "报告类型/计划报告/单独报告", required = false, allowableValues = "range[1, 100]") private String reportType; - - /** 执行模式/scenario/api/test_paln_api/test_pan_scenario */ - - - @ApiModelProperty(name = "执行模式/scenario/api/test_paln_api/test_pan_scenario") + + + @ApiModelProperty(name = "执行模式/scenario/api/test_paln_api/test_pan_scenario", required = false, allowableValues = "range[1, 100]") private String runMode; - - /** 执行资源池 */ - - - @ApiModelProperty(name = "执行资源池") + + + @ApiModelProperty(name = "执行资源池", required = false, allowableValues = "range[1, 100]") private String poolId; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = false, allowableValues = "range[1, ]") private Long createTime; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 1]") private Boolean failure; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ExecutionQueueDetail.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ExecutionQueueDetail.java index b34a8309fa..881bbdd4f2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ExecutionQueueDetail.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ExecutionQueueDetail.java @@ -2,13 +2,12 @@ package io.metersphere.sdk.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "执行链条目") @@ -16,72 +15,51 @@ import java.io.Serializable; @Data public class ExecutionQueueDetail implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{execution_queue_detail.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 队列id */ - - - @ApiModelProperty(name = "队列id") + + + @ApiModelProperty(name = "队列id", required = false, allowableValues = "range[1, 100]") private String queueId; - - /** 排序 */ - - - @ApiModelProperty(name = "排序") + + + @ApiModelProperty(name = "排序", required = false, allowableValues = "range[1, ]") private Integer sort; - - /** 报告id */ - - - @ApiModelProperty(name = "报告id") + + + @ApiModelProperty(name = "报告id", required = false, allowableValues = "range[1, 100]") private String reportId; - - /** 资源id */ - - - @ApiModelProperty(name = "资源id") + + + @ApiModelProperty(name = "资源id", required = false, allowableValues = "range[1, 100]") private String testId; - - /** 环境 */ - - - @ApiModelProperty(name = "环境") + + + @ApiModelProperty(name = "环境", required = false, allowableValues = "range[1, ]") private String evnMap; - - /** 资源类型 */ - - - @ApiModelProperty(name = "资源类型") + + + @ApiModelProperty(name = "资源类型", required = false, allowableValues = "range[1, 100]") private String type; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = false, allowableValues = "range[1, ]") private Long createTime; - - /** 是否开启失败重试 */ - - - @ApiModelProperty(name = "是否开启失败重试") + + + @ApiModelProperty(name = "是否开启失败重试", required = false, allowableValues = "range[1, 1]") private Boolean retryEnable; - - /** 失败重试次数 */ - - - @ApiModelProperty(name = "失败重试次数") + + + @ApiModelProperty(name = "失败重试次数", required = false, allowableValues = "range[1, ]") private Long retryNumber; - - /** 项目ID集合 */ - - - @ApiModelProperty(name = "项目ID集合") + + + @ApiModelProperty(name = "项目ID集合", required = false, allowableValues = "range[1, 2000]") private String projectIds; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/RelationshipEdge.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/RelationshipEdge.java index 125dd6a56f..afac79a0b5 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/RelationshipEdge.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/RelationshipEdge.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "关系图") @@ -16,42 +17,35 @@ import java.io.Serializable; @Data public class RelationshipEdge implements Serializable { private static final long serialVersionUID = 1L; - - /** 源节点的ID */ + @TableId - @NotBlank(message = "源节点的ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "源节点的ID") + @NotBlank(message = "{relationship_edge.source_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "源节点的ID", required = true, allowableValues = "range[1, 50]") private String sourceId; - - /** 目标节点的ID */ + @TableId - @NotBlank(message = "目标节点的ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "目标节点的ID") + @NotBlank(message = "{relationship_edge.target_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "目标节点的ID", required = true, allowableValues = "range[1, 50]") private String targetId; - - /** 边的分类 */ - @Size(min = 1, max = 20, message = "边的分类长度必须在1-20之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "边的分类不能为空", groups = {Created.class}) - @ApiModelProperty(name = "边的分类") + + @Size(min = 1, max = 20, message = "{relationship_edge.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{relationship_edge.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "边的分类", required = true, allowableValues = "range[1, 20]") private String type; - - /** 所属关系图的ID */ - @Size(min = 1, max = 50, message = "所属关系图的ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "所属关系图的ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "所属关系图的ID") + + @Size(min = 1, max = 50, message = "{relationship_edge.graph_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{relationship_edge.graph_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "所属关系图的ID", required = true, allowableValues = "range[1, 50]") private String graphId; - - /** 创建人 */ - @Size(min = 1, max = 50, message = "创建人长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "创建人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "创建人") + + @Size(min = 1, max = 50, message = "{relationship_edge.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{relationship_edge.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "创建人", required = true, allowableValues = "range[1, 50]") private String createUser; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, ]") private Long createTime; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ShareInfo.java b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ShareInfo.java index 03d8995d5d..761cb5670c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ShareInfo.java +++ b/backend/framework/domain/src/main/java/io/metersphere/sdk/domain/ShareInfo.java @@ -2,13 +2,12 @@ package io.metersphere.sdk.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "分享") @@ -16,48 +15,35 @@ import java.io.Serializable; @Data public class ShareInfo implements Serializable { private static final long serialVersionUID = 1L; - - /** 分享ID */ + @TableId - @NotBlank(message = "分享ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "分享ID") + @NotBlank(message = "{share_info.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "分享ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 64]") private String createUser; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 分享类型single batch */ - - - @ApiModelProperty(name = "分享类型single batch") + + + @ApiModelProperty(name = "分享类型single batch", required = false, allowableValues = "range[1, 64]") private String shareType; - - /** 分享扩展数据 */ - - - @ApiModelProperty(name = "分享扩展数据") + + + @ApiModelProperty(name = "分享扩展数据", required = false, allowableValues = "range[1, ]") private byte[] customData; - - /** 语言 */ - - - @ApiModelProperty(name = "语言") + + + @ApiModelProperty(name = "语言", required = false, allowableValues = "range[1, 10]") private String lang; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/AuthSource.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/AuthSource.java index 1ff1ccf64e..7e3a7ee56b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/AuthSource.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/AuthSource.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "三方认证源") @@ -16,54 +17,40 @@ import java.io.Serializable; @Data public class AuthSource implements Serializable { private static final long serialVersionUID = 1L; - - /** 认证源ID */ + @TableId - @NotBlank(message = "认证源ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "认证源ID") + @NotBlank(message = "{auth_source.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "认证源ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 认证源配置 */ - - - @ApiModelProperty(name = "认证源配置") + + + @ApiModelProperty(name = "认证源配置", required = true, allowableValues = "range[1, ]") private byte[] configuration; - - /** 状态 启用 禁用 */ - @Size(min = 1, max = 64, message = "状态 启用 禁用长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "状态 启用 禁用不能为空", groups = {Created.class}) - @ApiModelProperty(name = "状态 启用 禁用") + + @Size(min = 1, max = 64, message = "{auth_source.status.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{auth_source.status.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "状态 启用 禁用", required = true, allowableValues = "range[1, 64]") private String status; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 描述 */ - - - @ApiModelProperty(name = "描述") + + + @ApiModelProperty(name = "描述", required = false, allowableValues = "range[1, 255]") private String description; - - /** 名称 */ - - - @ApiModelProperty(name = "名称") + + + @ApiModelProperty(name = "名称", required = false, allowableValues = "range[1, 60]") private String name; - - /** 类型 */ - - - @ApiModelProperty(name = "类型") + + + @ApiModelProperty(name = "类型", required = false, allowableValues = "range[1, 30]") private String type; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/License.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/License.java index 7282bae83f..fe9aa4efef 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/License.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/License.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "") @@ -16,30 +17,23 @@ import java.io.Serializable; @Data public class License implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{license.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** Create timestamp */ - - - @ApiModelProperty(name = "Create timestamp") + + + @ApiModelProperty(name = "Create timestamp", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** Update timestamp */ - - - @ApiModelProperty(name = "Update timestamp") + + + @ApiModelProperty(name = "Update timestamp", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** license_code */ - - - @ApiModelProperty(name = "license_code") + + + @ApiModelProperty(name = "license_code", required = false, allowableValues = "range[1, ]") private String licenseCode; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTask.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTask.java index 12736e83e9..6df2f63f7b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTask.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTask.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "消息通知任务") @@ -16,60 +17,49 @@ import java.io.Serializable; @Data public class MessageTask implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{message_task.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 255]") private String id; - - /** 消息类型 */ - @Size(min = 1, max = 50, message = "消息类型长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "消息类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "消息类型") + + @Size(min = 1, max = 50, message = "{message_task.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{message_task.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "消息类型", required = true, allowableValues = "range[1, 50]") private String type; - - /** 通知事件类型 */ - @Size(min = 1, max = 255, message = "通知事件类型长度必须在1-255之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "通知事件类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "通知事件类型") + + @Size(min = 1, max = 255, message = "{message_task.event.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{message_task.event.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "通知事件类型", required = true, allowableValues = "range[1, 255]") private String event; - - /** 接收人id */ - @Size(min = 1, max = 50, message = "接收人id长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "接收人id不能为空", groups = {Created.class}) - @ApiModelProperty(name = "接收人id") + + @Size(min = 1, max = 50, message = "{message_task.receiver.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{message_task.receiver.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "接收人id", required = true, allowableValues = "range[1, 50]") private String receiver; - - /** 任务类型 */ - @Size(min = 1, max = 64, message = "任务类型长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "任务类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "任务类型") + + @Size(min = 1, max = 64, message = "{message_task.task_type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{message_task.task_type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "任务类型", required = true, allowableValues = "range[1, 64]") private String taskType; - - /** webhook地址 */ - - - @ApiModelProperty(name = "webhook地址") + + + @ApiModelProperty(name = "webhook地址", required = false, allowableValues = "range[1, 255]") private String webhook; - - /** 具体测试的ID */ - @Size(min = 1, max = 255, message = "具体测试的ID长度必须在1-255之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "具体测试的ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "具体测试的ID") + + @Size(min = 1, max = 255, message = "{message_task.test_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{message_task.test_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "具体测试的ID", required = true, allowableValues = "range[1, 255]") private String testId; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 项目ID */ - @Size(min = 1, max = 64, message = "项目ID长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "项目ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "项目ID") + + @Size(min = 1, max = 64, message = "{message_task.project_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{message_task.project_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "项目ID", required = true, allowableValues = "range[1, 64]") private String projectId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTaskBlob.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTaskBlob.java index 99fa0fc392..a6e3b5cbbd 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTaskBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTaskBlob.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "消息通知任务大字段") @@ -16,18 +17,15 @@ import java.io.Serializable; @Data public class MessageTaskBlob implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{message_task_blob.message_task_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 255]") private String messageTaskId; - - /** 消息模版 */ - - - @ApiModelProperty(name = "消息模版") + + + @ApiModelProperty(name = "消息模版", required = false, allowableValues = "range[1, ]") private String template; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Notification.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Notification.java index 4cc242e57b..4fa40234ff 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Notification.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Notification.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "消息通知") @@ -16,72 +17,60 @@ import java.io.Serializable; @Data public class Notification implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{notification.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, ]") private Long id; - - /** 通知类型 */ - @Size(min = 1, max = 30, message = "通知类型长度必须在1-30之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "通知类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "通知类型") + + @Size(min = 1, max = 30, message = "{notification.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "通知类型", required = true, allowableValues = "range[1, 30]") private String type; - - /** 接收人 */ - @Size(min = 1, max = 50, message = "接收人长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "接收人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "接收人") + + @Size(min = 1, max = 50, message = "{notification.receiver.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.receiver.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "接收人", required = true, allowableValues = "range[1, 50]") private String receiver; - - /** 标题 */ - @Size(min = 1, max = 100, message = "标题长度必须在1-100之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "标题不能为空", groups = {Created.class}) - @ApiModelProperty(name = "标题") + + @Size(min = 1, max = 100, message = "{notification.title.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.title.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "标题", required = true, allowableValues = "range[1, 100]") private String title; - - /** 状态 */ - @Size(min = 1, max = 30, message = "状态长度必须在1-30之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "状态不能为空", groups = {Created.class}) - @ApiModelProperty(name = "状态") + + @Size(min = 1, max = 30, message = "{notification.status.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.status.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "状态", required = true, allowableValues = "range[1, 30]") private String status; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 操作人 */ - @Size(min = 1, max = 50, message = "操作人长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "操作人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "操作人") + + @Size(min = 1, max = 50, message = "{notification.operator.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.operator.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "操作人", required = true, allowableValues = "range[1, 50]") private String operator; - - /** 操作 */ - @Size(min = 1, max = 50, message = "操作长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "操作不能为空", groups = {Created.class}) - @ApiModelProperty(name = "操作") + + @Size(min = 1, max = 50, message = "{notification.operation.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.operation.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "操作", required = true, allowableValues = "range[1, 50]") private String operation; - - /** 资源ID */ - @Size(min = 1, max = 50, message = "资源ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "资源ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "资源ID") + + @Size(min = 1, max = 50, message = "{notification.resource_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.resource_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "资源ID", required = true, allowableValues = "range[1, 50]") private String resourceId; - - /** 资源类型 */ - @Size(min = 1, max = 50, message = "资源类型长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "资源类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "资源类型") + + @Size(min = 1, max = 50, message = "{notification.resource_type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.resource_type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "资源类型", required = true, allowableValues = "range[1, 50]") private String resourceType; - - /** 资源名称 */ - @Size(min = 1, max = 100, message = "资源名称长度必须在1-100之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "资源名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "资源名称") + + @Size(min = 1, max = 100, message = "{notification.resource_name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{notification.resource_name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "资源名称", required = true, allowableValues = "range[1, 100]") private String resourceName; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/NoviceStatistics.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/NoviceStatistics.java index 9e2cf79e08..b2c820b778 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/NoviceStatistics.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/NoviceStatistics.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "新手村") @@ -16,48 +17,36 @@ import java.io.Serializable; @Data public class NoviceStatistics implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{novice_statistics.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 50]") private String id; - - /** 用户id */ - - - @ApiModelProperty(name = "用户id") + + + @ApiModelProperty(name = "用户id", required = false, allowableValues = "range[1, 64]") private String userId; - - /** 新手引导完成的步骤 */ - @Size(min = 1, max = 1, message = "新手引导完成的步骤长度必须在1-1之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "新手引导完成的步骤不能为空", groups = {Created.class}) - @ApiModelProperty(name = "新手引导完成的步骤") + + @Size(min = 1, max = 1, message = "{novice_statistics.guide_step.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{novice_statistics.guide_step.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "新手引导完成的步骤", required = true, allowableValues = "range[1, 1]") private Boolean guideStep; - - /** 新手引导的次数 */ - - - @ApiModelProperty(name = "新手引导的次数") + + + @ApiModelProperty(name = "新手引导的次数", required = true, allowableValues = "range[1, ]") private Integer guideNum; - - /** data option (JSON format) */ - - - @ApiModelProperty(name = "data option (JSON format)") + + + @ApiModelProperty(name = "data option (JSON format)", required = false, allowableValues = "range[1, ]") private byte[] dataOption; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private Long createTime; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private Long updateTime; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/OperatingLog.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/OperatingLog.java index c1c69034c2..335ecd0370 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/OperatingLog.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/OperatingLog.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "操作日志") @@ -16,84 +17,60 @@ import java.io.Serializable; @Data public class OperatingLog implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{operating_log.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 项目ID */ - @Size(min = 1, max = 50, message = "项目ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "项目ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "项目ID") + + @Size(min = 1, max = 50, message = "{operating_log.project_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{operating_log.project_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "项目ID", required = true, allowableValues = "range[1, 50]") private String projectId; - - /** operating method */ - - - @ApiModelProperty(name = "operating method") + + + @ApiModelProperty(name = "operating method", required = false, allowableValues = "range[1, 500]") private String operMethod; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 100]") private String createUser; - - /** 操作人 */ - - - @ApiModelProperty(name = "操作人") + + + @ApiModelProperty(name = "操作人", required = false, allowableValues = "range[1, 50]") private String operUser; - - /** 资源ID */ - - - @ApiModelProperty(name = "资源ID") + + + @ApiModelProperty(name = "资源ID", required = false, allowableValues = "range[1, 6000]") private String sourceId; - - /** 操作类型 */ - - - @ApiModelProperty(name = "操作类型") + + + @ApiModelProperty(name = "操作类型", required = false, allowableValues = "range[1, 100]") private String operType; - - /** 操作模块 */ - - - @ApiModelProperty(name = "操作模块") + + + @ApiModelProperty(name = "操作模块", required = false, allowableValues = "range[1, 100]") private String operModule; - - /** 操作标题 */ - - - @ApiModelProperty(name = "操作标题") + + + @ApiModelProperty(name = "操作标题", required = false, allowableValues = "range[1, 6000]") private String operTitle; - - /** 操作路径 */ - - - @ApiModelProperty(name = "操作路径") + + + @ApiModelProperty(name = "操作路径", required = false, allowableValues = "range[1, 500]") private String operPath; - - /** 操作内容 */ - - - @ApiModelProperty(name = "操作内容") + + + @ApiModelProperty(name = "操作内容", required = false, allowableValues = "range[1, ]") private byte[] operContent; - - /** 操作参数 */ - - - @ApiModelProperty(name = "操作参数") + + + @ApiModelProperty(name = "操作参数", required = false, allowableValues = "range[1, ]") private byte[] operParams; - - /** 操作时间 */ - - - @ApiModelProperty(name = "操作时间") + + + @ApiModelProperty(name = "操作时间", required = true, allowableValues = "range[1, ]") private Long operTime; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/OperatingLogResource.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/OperatingLogResource.java index c375f65005..0401ee9d18 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/OperatingLogResource.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/OperatingLogResource.java @@ -17,22 +17,19 @@ import java.io.Serializable; public class OperatingLogResource implements Serializable { private static final long serialVersionUID = 1L; - /** ID */ @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{operating_log_resource.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues="range[1, 50]") private String id; - /** Operating log ID */ - @Size(min = 1, max = 50, message = "Operating log ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Operating log ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Operating log ID") + @Size(min = 1, max = 50, message = "{operating_log_resource.operating_log_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{operating_log_resource.operating_log_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Operating log ID", required = true, allowableValues="range[1, 50]") private String operatingLogId; - /** operating source id */ - @Size(min = 1, max = 50, message = "operating source id长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "operating source id不能为空", groups = {Created.class}) - @ApiModelProperty(name = "operating source id") + @Size(min = 1, max = 50, message = "{operating_log_resource.source_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{operating_log_resource.source_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "operating source id", required = true, allowableValues="range[1, 50]") private String sourceId; diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Plugin.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Plugin.java index 479aa779b6..ce63abc828 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Plugin.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Plugin.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "插件") @@ -16,90 +17,70 @@ import java.io.Serializable; @Data public class Plugin implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{plugin.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** plugin name */ - - - @ApiModelProperty(name = "plugin name") + + + @ApiModelProperty(name = "plugin name", required = false, allowableValues = "range[1, 300]") private String name; - - /** Plugin id */ - @Size(min = 1, max = 300, message = "Plugin id长度必须在1-300之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Plugin id不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Plugin id") + + @Size(min = 1, max = 300, message = "{plugin.plugin_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{plugin.plugin_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Plugin id", required = true, allowableValues = "range[1, 300]") private String pluginId; - - /** Ui script id */ - @Size(min = 1, max = 300, message = "Ui script id长度必须在1-300之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Ui script id不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Ui script id") + + @Size(min = 1, max = 300, message = "{plugin.script_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{plugin.script_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Ui script id", required = true, allowableValues = "range[1, 300]") private String scriptId; - - /** Plugin clazzName */ - @Size(min = 1, max = 500, message = "Plugin clazzName长度必须在1-500之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Plugin clazzName不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Plugin clazzName") + + @Size(min = 1, max = 500, message = "{plugin.clazz_name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{plugin.clazz_name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Plugin clazzName", required = true, allowableValues = "range[1, 500]") private String clazzName; - - /** Jmeter base clazzName */ - @Size(min = 1, max = 300, message = "Jmeter base clazzName长度必须在1-300之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Jmeter base clazzName不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Jmeter base clazzName") + + @Size(min = 1, max = 300, message = "{plugin.jmeter_clazz.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{plugin.jmeter_clazz.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Jmeter base clazzName", required = true, allowableValues = "range[1, 300]") private String jmeterClazz; - - /** Plugin jar path */ - @Size(min = 1, max = 300, message = "Plugin jar path长度必须在1-300之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Plugin jar path不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Plugin jar path") + + @Size(min = 1, max = 300, message = "{plugin.source_path.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{plugin.source_path.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Plugin jar path", required = true, allowableValues = "range[1, 300]") private String sourcePath; - - /** Plugin jar name */ - @Size(min = 1, max = 300, message = "Plugin jar name长度必须在1-300之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Plugin jar name不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Plugin jar name") + + @Size(min = 1, max = 300, message = "{plugin.source_name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{plugin.source_name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Plugin jar name", required = true, allowableValues = "range[1, 300]") private String sourceName; - - /** plugin init entry class */ - - - @ApiModelProperty(name = "plugin init entry class") + + + @ApiModelProperty(name = "plugin init entry class", required = false, allowableValues = "range[1, 300]") private String execEntry; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private Long createTime; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, ]") private Long updateTime; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 50]") private String createUser; - - /** Is xpack plugin */ - - - @ApiModelProperty(name = "Is xpack plugin") + + + @ApiModelProperty(name = "Is xpack plugin", required = false, allowableValues = "range[1, 1]") private Boolean xpack; - - /** Plugin usage scenarios */ - @Size(min = 1, max = 50, message = "Plugin usage scenarios长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Plugin usage scenarios不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Plugin usage scenarios") + + @Size(min = 1, max = 50, message = "{plugin.scenario.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{plugin.scenario.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Plugin usage scenarios", required = true, allowableValues = "range[1, 50]") private String scenario; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginBlob.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginBlob.java index 394d98be8a..4cd83bad8c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginBlob.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "插件大字段") @@ -16,24 +17,19 @@ import java.io.Serializable; @Data public class PluginBlob implements Serializable { private static final long serialVersionUID = 1L; - - /** ID */ + @TableId - @NotBlank(message = "ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "ID") + @NotBlank(message = "{plugin_blob.plugin_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "ID", required = true, allowableValues = "range[1, 50]") private String pluginId; - - /** plugin form option */ - - - @ApiModelProperty(name = "plugin form option") + + + @ApiModelProperty(name = "plugin form option", required = false, allowableValues = "range[1, ]") private byte[] formOption; - - /** plugin form script */ - - - @ApiModelProperty(name = "plugin form script") + + + @ApiModelProperty(name = "plugin form script", required = false, allowableValues = "range[1, ]") private byte[] formScript; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Quota.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Quota.java index 1cfe238a68..878816e8e4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Quota.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Quota.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "配额") @@ -16,90 +17,63 @@ import java.io.Serializable; @Data public class Quota implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{quota.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 50]") private String id; - - /** 接口数量 */ - - - @ApiModelProperty(name = "接口数量") + + + @ApiModelProperty(name = "接口数量", required = false, allowableValues = "range[1, ]") private Integer api; - - /** 性能测试数量 */ - - - @ApiModelProperty(name = "性能测试数量") + + + @ApiModelProperty(name = "性能测试数量", required = false, allowableValues = "range[1, ]") private Integer performance; - - /** 最大并发数 */ - - - @ApiModelProperty(name = "最大并发数") + + + @ApiModelProperty(name = "最大并发数", required = false, allowableValues = "range[1, ]") private Integer maxThreads; - - /** 最大执行时长 */ - - - @ApiModelProperty(name = "最大执行时长") + + + @ApiModelProperty(name = "最大执行时长", required = false, allowableValues = "range[1, ]") private Integer duration; - - /** 资源池列表 */ - - - @ApiModelProperty(name = "资源池列表") + + + @ApiModelProperty(name = "资源池列表", required = false, allowableValues = "range[1, 1000]") private String resourcePool; - - /** 工作空间ID */ - - - @ApiModelProperty(name = "工作空间ID") + + + @ApiModelProperty(name = "工作空间ID", required = false, allowableValues = "range[1, 50]") private String workspaceId; - - /** 是否使用默认值 */ - - - @ApiModelProperty(name = "是否使用默认值") + + + @ApiModelProperty(name = "是否使用默认值", required = false, allowableValues = "range[1, 1]") private Boolean useDefault; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = false, allowableValues = "range[1, ]") private Long updateTime; - - /** 成员数量限制 */ - - - @ApiModelProperty(name = "成员数量限制") + + + @ApiModelProperty(name = "成员数量限制", required = false, allowableValues = "range[1, ]") private Integer member; - - /** 项目数量限制 */ - - - @ApiModelProperty(name = "项目数量限制") + + + @ApiModelProperty(name = "项目数量限制", required = false, allowableValues = "range[1, ]") private Integer project; - - /** 项目类型配额 */ - - - @ApiModelProperty(name = "项目类型配额") + + + @ApiModelProperty(name = "项目类型配额", required = false, allowableValues = "range[1, 50]") private String projectId; - - /** 总vum数 */ - - - @ApiModelProperty(name = "总vum数") + + + @ApiModelProperty(name = "总vum数", required = false, allowableValues = "range[1, 10]") private Double vumTotal; - - /** 消耗的vum数 */ - - - @ApiModelProperty(name = "消耗的vum数") + + + @ApiModelProperty(name = "消耗的vum数", required = false, allowableValues = "range[1, 10]") private Double vumUsed; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Schedule.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Schedule.java index 54cd49f586..f3edfb6333 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Schedule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Schedule.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "定时任务") @@ -16,84 +17,63 @@ import java.io.Serializable; @Data public class Schedule implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{schedule.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 50]") private String id; - - /** qrtz UUID */ - - - @ApiModelProperty(name = "qrtz UUID") + + + @ApiModelProperty(name = "qrtz UUID", required = false, allowableValues = "range[1, 50]") private String key; - - /** 资源类型 */ - @Size(min = 1, max = 50, message = "资源类型长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "资源类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "资源类型") + + @Size(min = 1, max = 50, message = "{schedule.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{schedule.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "资源类型", required = true, allowableValues = "range[1, 50]") private String type; - - /** Schedule value */ - @Size(min = 1, max = 255, message = "Schedule value长度必须在1-255之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Schedule value不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Schedule value") + + @Size(min = 1, max = 255, message = "{schedule.value.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{schedule.value.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Schedule value", required = true, allowableValues = "range[1, 255]") private String value; - - /** Schedule Job Class Name */ - @Size(min = 1, max = 64, message = "Schedule Job Class Name长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Schedule Job Class Name不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Schedule Job Class Name") + + @Size(min = 1, max = 64, message = "{schedule.job.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{schedule.job.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Schedule Job Class Name", required = true, allowableValues = "range[1, 64]") private String job; - - /** Schedule Eable */ - - - @ApiModelProperty(name = "Schedule Eable") + + + @ApiModelProperty(name = "Schedule Eable", required = false, allowableValues = "range[1, 1]") private Boolean enable; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = false, allowableValues = "range[1, 50]") private String resourceId; - - /** 创建人 */ - @Size(min = 1, max = 50, message = "创建人长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "创建人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "创建人") + + @Size(min = 1, max = 50, message = "{schedule.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{schedule.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "创建人", required = true, allowableValues = "range[1, 50]") private String createUser; - - /** Create timestamp */ - - - @ApiModelProperty(name = "Create timestamp") + + + @ApiModelProperty(name = "Create timestamp", required = false, allowableValues = "range[1, ]") private Long createTime; - - /** Update timestamp */ - - - @ApiModelProperty(name = "Update timestamp") + + + @ApiModelProperty(name = "Update timestamp", required = false, allowableValues = "range[1, ]") private Long updateTime; - - /** 项目ID */ - - - @ApiModelProperty(name = "项目ID") + + + @ApiModelProperty(name = "项目ID", required = false, allowableValues = "range[1, 50]") private String projectId; - - /** 名称 */ - - - @ApiModelProperty(name = "名称") + + + @ApiModelProperty(name = "名称", required = false, allowableValues = "range[1, 100]") private String name; - - /** 配置 */ - - - @ApiModelProperty(name = "配置") + + + @ApiModelProperty(name = "配置", required = false, allowableValues = "range[1, 1000]") private String config; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/ServiceIntegration.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/ServiceIntegration.java index 1862f031d8..179d8e0bce 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/ServiceIntegration.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/ServiceIntegration.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "服务集成") @@ -16,30 +17,24 @@ import java.io.Serializable; @Data public class ServiceIntegration implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{service_integration.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 50]") private String id; - - /** 平台 */ - @Size(min = 1, max = 50, message = "平台长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "平台不能为空", groups = {Created.class}) - @ApiModelProperty(name = "平台") + + @Size(min = 1, max = 50, message = "{service_integration.platform.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{service_integration.platform.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "平台", required = true, allowableValues = "range[1, 50]") private String platform; - - /** */ - - - @ApiModelProperty(name = "") + + + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, ]") private byte[] configuration; - - /** 工作空间ID */ - - - @ApiModelProperty(name = "工作空间ID") + + + @ApiModelProperty(name = "工作空间ID", required = false, allowableValues = "range[1, 50]") private String workspaceId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/SystemParameter.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/SystemParameter.java index e88c1a0dd4..49efe81b07 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/SystemParameter.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/SystemParameter.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "系统参数") @@ -16,24 +17,20 @@ import java.io.Serializable; @Data public class SystemParameter implements Serializable { private static final long serialVersionUID = 1L; - - /** 参数名称 */ + @TableId - @NotBlank(message = "参数名称不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "参数名称") + @NotBlank(message = "{system_parameter.param_key.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "参数名称", required = true, allowableValues = "range[1, 64]") private String paramKey; - - /** 参数值 */ - - - @ApiModelProperty(name = "参数值") + + + @ApiModelProperty(name = "参数值", required = false, allowableValues = "range[1, 255]") private String paramValue; - - /** 类型 */ - @Size(min = 1, max = 100, message = "类型长度必须在1-100之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "类型") + + @Size(min = 1, max = 100, message = "{system_parameter.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{system_parameter.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "类型", required = true, allowableValues = "range[1, 100]") private String type; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResource.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResource.java index 0c32019fc3..04d2a36380 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResource.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResource.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "测试资源池节点") @@ -16,42 +17,33 @@ import java.io.Serializable; @Data public class TestResource implements Serializable { private static final long serialVersionUID = 1L; - - /** Test resource ID */ + @TableId - @NotBlank(message = "Test resource ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "Test resource ID") + @NotBlank(message = "{test_resource.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "Test resource ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** Test resource pool ID this test resource belongs to */ - @Size(min = 1, max = 50, message = "Test resource pool ID this test resource belongs to长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Test resource pool ID this test resource belongs to不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Test resource pool ID this test resource belongs to") + + @Size(min = 1, max = 50, message = "{test_resource.test_resource_pool_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{test_resource.test_resource_pool_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Test resource pool ID this test resource belongs to", required = true, allowableValues = "range[1, 50]") private String testResourcePoolId; - - /** Test resource configuration */ - - - @ApiModelProperty(name = "Test resource configuration") + + + @ApiModelProperty(name = "Test resource configuration", required = false, allowableValues = "range[1, ]") private byte[] configuration; - - /** Test resource status */ - @Size(min = 1, max = 64, message = "Test resource status长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "Test resource status不能为空", groups = {Created.class}) - @ApiModelProperty(name = "Test resource status") + + @Size(min = 1, max = 64, message = "{test_resource.status.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{test_resource.status.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "Test resource status", required = true, allowableValues = "range[1, 64]") private String status; - - /** Create timestamp */ - - - @ApiModelProperty(name = "Create timestamp") + + + @ApiModelProperty(name = "Create timestamp", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** Update timestamp */ - - - @ApiModelProperty(name = "Update timestamp") + + + @ApiModelProperty(name = "Update timestamp", required = true, allowableValues = "range[1, ]") private Long updateTime; - + } \ No newline at end of file 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 4d6b0542e6..0e83d58fd4 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 @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "测试资源池") @@ -16,84 +17,62 @@ import java.io.Serializable; @Data public class TestResourcePool implements Serializable { private static final long serialVersionUID = 1L; - - /** 资源池ID */ + @TableId - @NotBlank(message = "资源池ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "资源池ID") + @NotBlank(message = "{test_resource_pool.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "资源池ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 名称 */ - @Size(min = 1, max = 64, message = "名称长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "名称") + + @Size(min = 1, max = 64, message = "{test_resource_pool.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{test_resource_pool.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "名称", required = true, allowableValues = "range[1, 64]") private String name; - - /** 类型 */ - @Size(min = 1, max = 30, message = "类型长度必须在1-30之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "类型") + + @Size(min = 1, max = 30, message = "{test_resource_pool.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{test_resource_pool.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "类型", required = true, allowableValues = "range[1, 30]") private String type; - - /** 描述 */ - - - @ApiModelProperty(name = "描述") + + + @ApiModelProperty(name = "描述", required = false, allowableValues = "range[1, 255]") private String description; - - /** 状态 */ - @Size(min = 1, max = 64, message = "状态长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "状态不能为空", groups = {Created.class}) - @ApiModelProperty(name = "状态") + + @Size(min = 1, max = 64, message = "{test_resource_pool.status.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{test_resource_pool.status.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "状态", required = true, allowableValues = "range[1, 64]") private String status; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 性能测试镜像 */ - - - @ApiModelProperty(name = "性能测试镜像") + + + @ApiModelProperty(name = "性能测试镜像", required = false, allowableValues = "range[1, 100]") private String image; - - /** 性能测试jvm配置 */ - - - @ApiModelProperty(name = "性能测试jvm配置") + + + @ApiModelProperty(name = "性能测试jvm配置", required = false, allowableValues = "range[1, 200]") private String heap; - - /** 性能测试gc配置 */ - - - @ApiModelProperty(name = "性能测试gc配置") + + + @ApiModelProperty(name = "性能测试gc配置", required = false, allowableValues = "range[1, 200]") private String gcAlgo; - - /** 创建人 */ - - - @ApiModelProperty(name = "创建人") + + + @ApiModelProperty(name = "创建人", required = false, allowableValues = "range[1, 100]") private String createUser; - - /** 是否用于接口测试 */ - - - @ApiModelProperty(name = "是否用于接口测试") + + + @ApiModelProperty(name = "是否用于接口测试", required = false, allowableValues = "range[1, 1]") private Boolean api; - - /** 是否用于性能测试 */ - - - @ApiModelProperty(name = "是否用于性能测试") + + + @ApiModelProperty(name = "是否用于性能测试", required = false, allowableValues = "range[1, 1]") private Boolean performance; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/User.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/User.java index 9cfd1c5975..76204f9140 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/User.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/User.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "用户") @@ -16,84 +17,64 @@ import java.io.Serializable; @Data public class User implements Serializable { private static final long serialVersionUID = 1L; - - /** 用户ID */ + @TableId - @NotBlank(message = "用户ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "用户ID") + @NotBlank(message = "{user.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "用户ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 用户名 */ - @Size(min = 1, max = 64, message = "用户名长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "用户名不能为空", groups = {Created.class}) - @ApiModelProperty(name = "用户名") + + @Size(min = 1, max = 64, message = "{user.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "用户名", required = true, allowableValues = "range[1, 64]") private String name; - - /** 用户邮箱 */ - @Size(min = 1, max = 64, message = "用户邮箱长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "用户邮箱不能为空", groups = {Created.class}) - @ApiModelProperty(name = "用户邮箱") + + @Size(min = 1, max = 64, message = "{user.email.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user.email.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "用户邮箱", required = true, allowableValues = "range[1, 64]") private String email; - - /** 用户密码 */ - - - @ApiModelProperty(name = "用户密码") + + + @ApiModelProperty(name = "用户密码", required = false, allowableValues = "range[1, 256]") private String password; - - /** 用户状态,启用或禁用 */ - @Size(min = 1, max = 50, message = "用户状态,启用或禁用长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "用户状态,启用或禁用不能为空", groups = {Created.class}) - @ApiModelProperty(name = "用户状态,启用或禁用") + + @Size(min = 1, max = 50, message = "{user.status.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user.status.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "用户状态,启用或禁用", required = true, allowableValues = "range[1, 50]") private String status; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 语言 */ - - - @ApiModelProperty(name = "语言") + + + @ApiModelProperty(name = "语言", required = false, allowableValues = "range[1, 30]") private String language; - - /** 当前工作空间ID */ - - - @ApiModelProperty(name = "当前工作空间ID") + + + @ApiModelProperty(name = "当前工作空间ID", required = false, allowableValues = "range[1, 50]") private String lastWorkspaceId; - - /** 手机号 */ - - - @ApiModelProperty(name = "手机号") + + + @ApiModelProperty(name = "手机号", required = false, allowableValues = "range[1, 50]") private String phone; - - /** 来源:LOCAL OIDC CAS */ - @Size(min = 1, max = 50, message = "来源:LOCAL OIDC CAS长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "来源:LOCAL OIDC CAS不能为空", groups = {Created.class}) - @ApiModelProperty(name = "来源:LOCAL OIDC CAS") + + @Size(min = 1, max = 50, message = "{user.source.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user.source.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "来源:LOCAL OIDC CAS", required = true, allowableValues = "range[1, 50]") private String source; - - /** 当前项目ID */ - - - @ApiModelProperty(name = "当前项目ID") + + + @ApiModelProperty(name = "当前项目ID", required = false, allowableValues = "range[1, 50]") private String lastProjectId; - - /** 创建人 */ - @Size(min = 1, max = 100, message = "创建人长度必须在1-100之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "创建人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "创建人") + + @Size(min = 1, max = 100, message = "{user.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "创建人", required = true, allowableValues = "range[1, 100]") private String createUser; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserExtend.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserExtend.java index 037bdb472c..9f2e6f0ba8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserExtend.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserExtend.java @@ -2,13 +2,12 @@ package io.metersphere.system.domain; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.Updated; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "用户扩展") @@ -16,24 +15,19 @@ import java.io.Serializable; @Data public class UserExtend implements Serializable { private static final long serialVersionUID = 1L; - - /** 用户ID */ + @TableId - @NotBlank(message = "用户ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "用户ID") + @NotBlank(message = "{user_extend.user_id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "用户ID", required = true, allowableValues = "range[1, 50]") private String userId; - - /** 其他平台对接信息 */ - - - @ApiModelProperty(name = "其他平台对接信息") + + + @ApiModelProperty(name = "其他平台对接信息", required = false, allowableValues = "range[1, 2000]") private byte[] platformInfo; - - /** UI本地调试地址 */ - - - @ApiModelProperty(name = "UI本地调试地址") + + + @ApiModelProperty(name = "UI本地调试地址", required = false, allowableValues = "range[1, 255]") private String seleniumServer; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserKey.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserKey.java index 195bea48c8..4c4b561dcf 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserKey.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserKey.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "用户api key") @@ -16,42 +17,34 @@ import java.io.Serializable; @Data public class UserKey implements Serializable { private static final long serialVersionUID = 1L; - - /** user_key ID */ + @TableId - @NotBlank(message = "user_key ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "user_key ID") + @NotBlank(message = "{user_key.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "user_key ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 用户ID */ - @Size(min = 1, max = 50, message = "用户ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "用户ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "用户ID") + + @Size(min = 1, max = 50, message = "{user_key.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_key.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "用户ID", required = true, allowableValues = "range[1, 50]") private String createUser; - - /** access_key */ - @Size(min = 1, max = 50, message = "access_key长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "access_key不能为空", groups = {Created.class}) - @ApiModelProperty(name = "access_key") + + @Size(min = 1, max = 50, message = "{user_key.access_key.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_key.access_key.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "access_key", required = true, allowableValues = "range[1, 50]") private String accessKey; - - /** secret key */ - @Size(min = 1, max = 50, message = "secret key长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "secret key不能为空", groups = {Created.class}) - @ApiModelProperty(name = "secret key") + + @Size(min = 1, max = 50, message = "{user_key.secret_key.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_key.secret_key.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "secret key", required = true, allowableValues = "range[1, 50]") private String secretKey; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 状态 */ - - - @ApiModelProperty(name = "状态") + + + @ApiModelProperty(name = "状态", required = false, allowableValues = "range[1, 10]") private String status; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRole.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRole.java index 62b0336f7f..8a6b0204cf 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRole.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRole.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "用户组") @@ -16,60 +17,48 @@ import java.io.Serializable; @Data public class UserRole implements Serializable { private static final long serialVersionUID = 1L; - - /** 组ID */ + @TableId - @NotBlank(message = "组ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "组ID") + @NotBlank(message = "{user_role.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "组ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 组名称 */ - @Size(min = 1, max = 64, message = "组名称长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "组名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "组名称") + + @Size(min = 1, max = 64, message = "{user_role.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "组名称", required = true, allowableValues = "range[1, 64]") private String name; - - /** 描述 */ - - - @ApiModelProperty(name = "描述") + + + @ApiModelProperty(name = "描述", required = false, allowableValues = "range[1, 100]") private String description; - - /** 是否是系统用户组 */ - @Size(min = 1, max = 1, message = "是否是系统用户组长度必须在1-1之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "是否是系统用户组不能为空", groups = {Created.class}) - @ApiModelProperty(name = "是否是系统用户组") + + @Size(min = 1, max = 1, message = "{user_role.system.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role.system.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "是否是系统用户组", required = true, allowableValues = "range[1, 1]") private Boolean system; - - /** 所属类型 */ - @Size(min = 1, max = 20, message = "所属类型长度必须在1-20之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "所属类型不能为空", groups = {Created.class}) - @ApiModelProperty(name = "所属类型") + + @Size(min = 1, max = 20, message = "{user_role.type.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role.type.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "所属类型", required = true, allowableValues = "range[1, 20]") private String type; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 创建人(操作人) */ - @Size(min = 1, max = 64, message = "创建人(操作人)长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "创建人(操作人)不能为空", groups = {Created.class}) - @ApiModelProperty(name = "创建人(操作人)") + + @Size(min = 1, max = 64, message = "{user_role.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "创建人(操作人)", required = true, allowableValues = "range[1, 64]") private String createUser; - - /** 应用范围 */ - @Size(min = 1, max = 64, message = "应用范围长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "应用范围不能为空", groups = {Created.class}) - @ApiModelProperty(name = "应用范围") + + @Size(min = 1, max = 64, message = "{user_role.scope_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role.scope_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "应用范围", required = true, allowableValues = "range[1, 64]") private String scopeId; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRolePermission.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRolePermission.java index 8595780faa..96ed7408db 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRolePermission.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRolePermission.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "用户组权限") @@ -16,30 +17,25 @@ import java.io.Serializable; @Data public class UserRolePermission implements Serializable { private static final long serialVersionUID = 1L; - - /** */ + @TableId - @NotBlank(message = "不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "") + @NotBlank(message = "{user_role_permission.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "", required = true, allowableValues = "range[1, 64]") private String id; - - /** 用户组ID */ - @Size(min = 1, max = 64, message = "用户组ID长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "用户组ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "用户组ID") + + @Size(min = 1, max = 64, message = "{user_role_permission.role_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role_permission.role_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "用户组ID", required = true, allowableValues = "range[1, 64]") private String roleId; - - /** 权限ID */ - @Size(min = 1, max = 128, message = "权限ID长度必须在1-128之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "权限ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "权限ID") + + @Size(min = 1, max = 128, message = "{user_role_permission.permission_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role_permission.permission_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "权限ID", required = true, allowableValues = "range[1, 128]") private String permissionId; - - /** 功能菜单 */ - @Size(min = 1, max = 64, message = "功能菜单长度必须在1-64之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "功能菜单不能为空", groups = {Created.class}) - @ApiModelProperty(name = "功能菜单") + + @Size(min = 1, max = 64, message = "{user_role_permission.module_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role_permission.module_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "功能菜单", required = true, allowableValues = "range[1, 64]") private String moduleId; - } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRoleRelation.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRoleRelation.java index df21281203..8f4ec11dc2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRoleRelation.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRoleRelation.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "用户组关系") @@ -16,42 +17,34 @@ import java.io.Serializable; @Data public class UserRoleRelation implements Serializable { private static final long serialVersionUID = 1L; - - /** 用户组关系ID */ + @TableId - @NotBlank(message = "用户组关系ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "用户组关系ID") + @NotBlank(message = "{user_role_relation.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "用户组关系ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 用户ID */ - @Size(min = 1, max = 50, message = "用户ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "用户ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "用户ID") + + @Size(min = 1, max = 50, message = "{user_role_relation.user_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role_relation.user_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "用户ID", required = true, allowableValues = "range[1, 50]") private String userId; - - /** 组ID */ - @Size(min = 1, max = 50, message = "组ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "组ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "组ID") + + @Size(min = 1, max = 50, message = "{user_role_relation.role_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role_relation.role_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "组ID", required = true, allowableValues = "range[1, 50]") private String roleId; - - /** 工作空间或项目ID */ - @Size(min = 1, max = 50, message = "工作空间或项目ID长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "工作空间或项目ID不能为空", groups = {Created.class}) - @ApiModelProperty(name = "工作空间或项目ID") + + @Size(min = 1, max = 50, message = "{user_role_relation.source_id.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{user_role_relation.source_id.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "工作空间或项目ID", required = true, allowableValues = "range[1, 50]") private String sourceId; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - + } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Workspace.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Workspace.java index 0cc4b45246..fa0a8e73f7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Workspace.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Workspace.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; import lombok.Data; + import java.io.Serializable; @ApiModel(value = "工作空间") @@ -16,42 +17,33 @@ import java.io.Serializable; @Data public class Workspace implements Serializable { private static final long serialVersionUID = 1L; - - /** 工作空间ID */ + @TableId - @NotBlank(message = "工作空间ID不能为空", groups = {Updated.class}) - @ApiModelProperty(name = "工作空间ID") + @NotBlank(message = "{workspace.id.not_blank}", groups = {Updated.class}) + @ApiModelProperty(name = "工作空间ID", required = true, allowableValues = "range[1, 50]") private String id; - - /** 工作空间名称 */ - @Size(min = 1, max = 100, message = "工作空间名称长度必须在1-100之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "工作空间名称不能为空", groups = {Created.class}) - @ApiModelProperty(name = "工作空间名称") + + @Size(min = 1, max = 100, message = "{workspace.name.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{workspace.name.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "工作空间名称", required = true, allowableValues = "range[1, 100]") private String name; - - /** 描述 */ - - - @ApiModelProperty(name = "描述") + + + @ApiModelProperty(name = "描述", required = false, allowableValues = "range[1, 255]") private String description; - - /** 创建时间 */ - - - @ApiModelProperty(name = "创建时间") + + + @ApiModelProperty(name = "创建时间", required = true, allowableValues = "range[1, ]") private Long createTime; - - /** 更新时间 */ - - - @ApiModelProperty(name = "更新时间") + + + @ApiModelProperty(name = "更新时间", required = true, allowableValues = "range[1, ]") private Long updateTime; - - /** 创建人 */ - @Size(min = 1, max = 50, message = "创建人长度必须在1-50之间", groups = {Created.class, Updated.class}) - @NotBlank(message = "创建人不能为空", groups = {Created.class}) - @ApiModelProperty(name = "创建人") + + @Size(min = 1, max = 50, message = "{workspace.create_user.length_range}", groups = {Created.class, Updated.class}) + @NotBlank(message = "{workspace.create_user.not_blank}", groups = {Created.class}) + @ApiModelProperty(name = "创建人", required = true, allowableValues = "range[1, 50]") private String createUser; - + } \ No newline at end of file