build: project domain

This commit is contained in:
CaptainB 2023-05-31 09:38:55 +08:00
parent dbd76ad824
commit e035e51b97
19 changed files with 53 additions and 98 deletions

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
@ -24,14 +22,13 @@ public class ApiTemplate implements Serializable {
private String description; private String description;
@Schema(title = "是否是系统模板", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "是否是系统模板", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{api_template.system.not_blank}", groups = {Created.class}) @NotNull(message = "{api_template.system.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{api_template.system.length_range}", groups = {Created.class, Updated.class})
private Boolean system; private Boolean system;
@Schema(title = "创建时间") @Schema(title = "创建时间")
private Long createTime; private Long createTime;
@Schema(title = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "创建人")
private String createUser; private String createUser;
@Schema(title = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
@ -52,8 +50,7 @@ public class CustomField implements Serializable {
private String projectId; private String projectId;
@Schema(title = "是否关联第三方", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "是否关联第三方", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{custom_field.third_part.not_blank}", groups = {Created.class}) @NotNull(message = "{custom_field.third_part.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{custom_field.third_part.length_range}", groups = {Created.class, Updated.class})
private Boolean thirdPart; private Boolean thirdPart;
@Schema(title = "自定义字段选项") @Schema(title = "自定义字段选项")

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
@ -26,10 +24,10 @@ public class FakeError implements Serializable {
@Schema(title = "更新时间") @Schema(title = "更新时间")
private Long updateTime; private Long updateTime;
@Schema(title = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "创建人")
private String createUser; private String createUser;
@Schema(title = "更新人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "更新人")
private String updateUser; private String updateUser;
@Schema(title = "错误码", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "错误码", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
@ -24,8 +22,7 @@ public class FileMetadata implements Serializable {
private String type; private String type;
@Schema(title = "文件大小", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "文件大小", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{file_metadata.size.not_blank}", groups = {Created.class}) @NotNull(message = "{file_metadata.size.not_blank}", groups = {Created.class})
@Size(min = 1, max = 19, message = "{file_metadata.size.length_range}", groups = {Created.class, Updated.class})
private Long size; private Long size;
@Schema(title = "创建时间") @Schema(title = "创建时间")
@ -44,10 +41,10 @@ public class FileMetadata implements Serializable {
@Size(min = 1, max = 50, message = "{file_metadata.storage.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 50, message = "{file_metadata.storage.length_range}", groups = {Created.class, Updated.class})
private String storage; private String storage;
@Schema(title = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "创建人")
private String createUser; private String createUser;
@Schema(title = "修改人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "修改人")
private String updateUser; private String updateUser;
@Schema(title = "标签") @Schema(title = "标签")
@ -69,8 +66,7 @@ public class FileMetadata implements Serializable {
private String resourceType; private String resourceType;
@Schema(title = "是否是最新版", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "是否是最新版", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{file_metadata.latest.not_blank}", groups = {Created.class}) @NotNull(message = "{file_metadata.latest.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{file_metadata.latest.length_range}", groups = {Created.class, Updated.class})
private Boolean latest; private Boolean latest;
@Schema(title = "同版本数据关联的ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "同版本数据关联的ID", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
@ -24,14 +22,13 @@ public class FunctionalCaseTemplate implements Serializable {
private String description; private String description;
@Schema(title = "是否是系统模板", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "是否是系统模板", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{functional_case_template.system.not_blank}", groups = {Created.class}) @NotNull(message = "{functional_case_template.system.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{functional_case_template.system.length_range}", groups = {Created.class, Updated.class})
private Boolean system; private Boolean system;
@Schema(title = "创建时间") @Schema(title = "创建时间")
private Long createTime; private Long createTime;
@Schema(title = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "创建人")
private String createUser; private String createUser;
@Schema(title = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
@ -24,14 +22,13 @@ public class IssueTemplate implements Serializable {
private String description; private String description;
@Schema(title = "是否是系统模板", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "是否是系统模板", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{issue_template.system.not_blank}", groups = {Created.class}) @NotNull(message = "{issue_template.system.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{issue_template.system.length_range}", groups = {Created.class, Updated.class})
private Boolean system; private Boolean system;
@Schema(title = "创建时间") @Schema(title = "创建时间")
private Long createTime; private Long createTime;
@Schema(title = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "创建人")
private String createUser; private String createUser;
@Schema(title = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.project.domain; package io.metersphere.project.domain;
import io.metersphere.validation.groups.Created; import io.metersphere.validation.groups.*;
import io.metersphere.validation.groups.Updated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.*;
import jakarta.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import lombok.Data; import lombok.Data;
@ -32,8 +30,7 @@ public class ProjectVersion implements Serializable {
private String status; private String status;
@Schema(title = "是否是最新版", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "是否是最新版", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{project_version.latest.not_blank}", groups = {Created.class}) @NotNull(message = "{project_version.latest.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{project_version.latest.length_range}", groups = {Created.class, Updated.class})
private Boolean latest; private Boolean latest;
@Schema(title = "发布时间") @Schema(title = "发布时间")
@ -48,7 +45,7 @@ public class ProjectVersion implements Serializable {
@Schema(title = "创建时间") @Schema(title = "创建时间")
private Long createTime; private Long createTime;
@Schema(title = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "创建人")
private String createUser; private String createUser;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;