build: system domain

This commit is contained in:
CaptainB 2023-05-31 09:39:44 +08:00
parent e035e51b97
commit f05eb7581f
23 changed files with 57 additions and 110 deletions

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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;
@ -36,8 +34,7 @@ public class AuthSource implements Serializable {
private String type; private String type;
@Schema(title = "认证源配置", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "认证源配置", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{auth_source.configuration.not_blank}", groups = {Created.class}) @NotNull(message = "{auth_source.configuration.not_blank}", groups = {Created.class})
@Size(min = 1, max = 65535, message = "{auth_source.configuration.length_range}", groups = {Created.class, Updated.class})
private byte[] configuration; private byte[] configuration;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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;
@ -12,7 +10,6 @@ import lombok.Data;
public class Notification implements Serializable { public class Notification implements Serializable {
@Schema(title = "ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{notification.id.not_blank}", groups = {Updated.class}) @NotBlank(message = "{notification.id.not_blank}", groups = {Updated.class})
@Size(min = 1, max = 19, message = "{notification.id.length_range}", groups = {Created.class, Updated.class})
private Long id; private Long id;
@Schema(title = "通知类型", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "通知类型", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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;
@ -19,13 +17,11 @@ public class NoviceStatistics implements Serializable {
private String userId; private String userId;
@Schema(title = "新手引导完成的步骤", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "新手引导完成的步骤", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{novice_statistics.guide_step.not_blank}", groups = {Created.class}) @NotNull(message = "{novice_statistics.guide_step.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{novice_statistics.guide_step.length_range}", groups = {Created.class, Updated.class})
private Boolean guideStep; private Boolean guideStep;
@Schema(title = "新手引导的次数", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "新手引导的次数", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{novice_statistics.guide_num.not_blank}", groups = {Created.class}) @NotNull(message = "{novice_statistics.guide_num.not_blank}", groups = {Created.class})
@Size(min = 1, max = 10, message = "{novice_statistics.guide_num.length_range}", groups = {Created.class, Updated.class})
private Integer guideNum; private Integer guideNum;
@Schema(title = "") @Schema(title = "")

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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;
@ -45,8 +43,7 @@ public class OperatingLog implements Serializable {
private String operPath; private String operPath;
@Schema(title = "操作时间", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "操作时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{operating_log.oper_time.not_blank}", groups = {Created.class}) @NotNull(message = "{operating_log.oper_time.not_blank}", groups = {Created.class})
@Size(min = 1, max = 19, message = "{operating_log.oper_time.length_range}", groups = {Created.class, Updated.class})
private Long operTime; private Long operTime;
@Schema(title = "操作内容") @Schema(title = "操作内容")

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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 java.math.BigDecimal; import java.math.BigDecimal;
import lombok.Data; import lombok.Data;

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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;
@ -39,7 +37,7 @@ public class Schedule implements Serializable {
@Schema(title = "") @Schema(title = "")
private String resourceId; private String resourceId;
@Schema(title = "创建人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "创建人")
private String createUser; private String createUser;
@Schema(title = "Create timestamp") @Schema(title = "Create timestamp")

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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 ServiceIntegration implements Serializable {
private String workspaceId; private String workspaceId;
@Schema(title = "", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{service_integration.configuration.not_blank}", groups = {Created.class}) @NotNull(message = "{service_integration.configuration.not_blank}", groups = {Created.class})
@Size(min = 1, max = 65535, message = "{service_integration.configuration.length_range}", groups = {Created.class, Updated.class})
private byte[] configuration; private byte[] configuration;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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;
@ -56,7 +54,7 @@ public class User implements Serializable {
@Schema(title = "当前项目ID") @Schema(title = "当前项目ID")
private String lastProjectId; private String lastProjectId;
@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;

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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;
@ -15,7 +13,7 @@ public class UserKey implements Serializable {
@Size(min = 1, max = 50, message = "{user_key.id.length_range}", groups = {Created.class, Updated.class}) @Size(min = 1, max = 50, message = "{user_key.id.length_range}", groups = {Created.class, Updated.class})
private String id; private String id;
@Schema(title = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "用户ID")
private String createUser; private String createUser;
@Schema(title = "access_key", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "access_key", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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 UserRole implements Serializable {
private String description; private String description;
@Schema(title = "是否是系统用户组", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "是否是系统用户组", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "{user_role.system.not_blank}", groups = {Created.class}) @NotNull(message = "{user_role.system.not_blank}", groups = {Created.class})
@Size(min = 1, max = 1, message = "{user_role.system.length_range}", groups = {Created.class, Updated.class})
private Boolean system; private Boolean system;
@Schema(title = "所属类型", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "所属类型", requiredMode = Schema.RequiredMode.REQUIRED)
@ -39,7 +36,7 @@ public class UserRole 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 = "应用范围", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -1,10 +1,8 @@
package io.metersphere.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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.system.domain; package io.metersphere.system.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;
@ -29,7 +27,7 @@ public class Workspace 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;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;