1. 添加部分swagger文档
This commit is contained in:
@@ -3,6 +3,7 @@ package com.realtime.protection.configuration.entity.defense.object;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@@ -13,20 +14,24 @@ import lombok.Data;
|
||||
public class ProtectObject {
|
||||
@JsonProperty("proobj_id")
|
||||
@ExcelIgnore
|
||||
@Schema(description = "防护对象ID", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private Integer protectObjectId;
|
||||
|
||||
@JsonProperty("proobj_name")
|
||||
@NotNull(message = "proobj_name should not be empty.")
|
||||
@ExcelProperty("名称")
|
||||
@Schema(description = "防护对象名称", example = "静态对象测试")
|
||||
private String protectObjectName;
|
||||
|
||||
@JsonProperty("proobj_system_name")
|
||||
@ExcelProperty("操作系统名称")
|
||||
@Schema(description = "防护对象操作系统名称", example = "xxx操作系统")
|
||||
private String protectObjectSystemName;
|
||||
|
||||
@JsonProperty("proobj_ip_address")
|
||||
@Pattern(regexp = "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$", message = "Invalid IPv4 Address")
|
||||
@ExcelProperty("IP地址")
|
||||
@Schema(description = "防护对象IPv4地址", example = "192.168.0.1")
|
||||
private String protectObjectIPAddress;
|
||||
|
||||
@JsonProperty("proobj_port")
|
||||
@@ -34,31 +39,38 @@ public class ProtectObject {
|
||||
@Max(value = 65535, message = "port should not be more than 65535")
|
||||
@Min(value = 1, message = "port should not be less than 1")
|
||||
@ExcelProperty("端口")
|
||||
@Schema(description = "防护对象端口", maximum = "65535", minimum = "1", example = "8080")
|
||||
private Integer protectObjectPort;
|
||||
|
||||
@JsonProperty("proobj_url")
|
||||
@NotNull(message = "proobj_url should not be empty.")
|
||||
@ExcelProperty("URL")
|
||||
@Schema(description = "防护对象URL", example = "alice.bob.com")
|
||||
private String protectObjectURL;
|
||||
|
||||
@JsonProperty("proobj_protocol")
|
||||
@NotNull(message = "proobj_protocol should not be empty.")
|
||||
@ExcelProperty("协议")
|
||||
@Schema(description = "防护对象网络协议(目前仅可以填写TCP或UDP)", example = "TCP")
|
||||
private String protectObjectProtocol;
|
||||
|
||||
@JsonProperty("proobj_audit_status")
|
||||
@ExcelIgnore
|
||||
@Schema(description = "防护对象审核状态(0为未审核,1为已退回,2为审核通过)", example = "2")
|
||||
private Integer protectObjectAuditStatus;
|
||||
|
||||
@JsonProperty("proobj_create_username")
|
||||
@ExcelIgnore
|
||||
@Schema(description = "防护对象创建人", example = "xxx", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private String protectObjectCreateUsername;
|
||||
|
||||
@JsonProperty("proobj_create_depart")
|
||||
@ExcelIgnore
|
||||
@Schema(description = "防护对象创建人处室", example = "xxx", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private String protectObjectCreateDepart;
|
||||
|
||||
@JsonProperty("proobj_create_userid")
|
||||
@ExcelIgnore
|
||||
@Schema(description = "防护对象创建人ID", example = "0", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private Integer protectObjectCreateUserId;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
package com.realtime.protection.configuration.entity.defense.template;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProtectLevel {
|
||||
@Schema(description = "防护等级ID", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private Integer protectLevelId;
|
||||
|
||||
@Schema(description = "该防护等级是否需要提取防护对象IP地址字段")
|
||||
private Boolean hasProtectObjectIP = false;
|
||||
|
||||
@Schema(description = "该防护等级是否需要提取防护对象端口字段")
|
||||
private Boolean hasProtectObjectPort = false;
|
||||
|
||||
@Schema(description = "该防护等级是否需要提取对端IP地址字段")
|
||||
private Boolean hasPeerIP = false;
|
||||
|
||||
@Schema(description = "该防护等级是否需要提取对端端口字段")
|
||||
private Boolean hasPeerPort = false;
|
||||
|
||||
@Schema(description = "该防护等级是否需要提取网络协议字段")
|
||||
private Boolean hasProtocol = false;
|
||||
|
||||
@Schema(description = "该防护等级是否需要提取URL字段")
|
||||
private Boolean hasURL = false;
|
||||
|
||||
@Schema(description = "该防护等级是否需要提取DNS")
|
||||
private Boolean hasDNS = false;
|
||||
}
|
||||
|
||||
@@ -1,49 +1,58 @@
|
||||
package com.realtime.protection.configuration.entity.defense.template;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Template {
|
||||
@JsonProperty("template_id")
|
||||
@Schema(description = "防御策略模板ID", example = "2", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private Integer templateId;
|
||||
|
||||
@JsonProperty("template_name")
|
||||
@NotNull(message = "template name should not be empty.")
|
||||
@Schema(description = "防御策略模板名称", example = "自定义模板")
|
||||
private String templateName;
|
||||
|
||||
@JsonProperty("template_running_tasks")
|
||||
private Integer templateRunningTasks;
|
||||
|
||||
@JsonProperty("template_used")
|
||||
private Integer templateUsedTimes;
|
||||
|
||||
@JsonProperty("source_system")
|
||||
@NotNull(message = "source_system should not be empty. ")
|
||||
@Schema(description = "防御策略模板数据来源系统", example = "BW系统")
|
||||
private String sourceSystem;
|
||||
|
||||
@JsonProperty("protect_level_low")
|
||||
@NotNull(message = "protect_level_low should not be empty. ")
|
||||
@Schema(description = "防御策略模板日常态字段提取选项")
|
||||
private ProtectLevel protectLevelLow;
|
||||
|
||||
@JsonProperty("protect_level_medium")
|
||||
@NotNull(message = "protect_level_medium should not be empty. ")
|
||||
@Schema(description = "防御策略模板应急态字段提取选项")
|
||||
private ProtectLevel protectLevelMedium;
|
||||
|
||||
@JsonProperty("protect_level_high")
|
||||
@NotNull(message = "protect_level_high should not be empty. ")
|
||||
@Schema(description = "防御策略模板紧急态字段提取选项")
|
||||
private ProtectLevel protectLevelHigh;
|
||||
|
||||
@JsonProperty("template_used_times")
|
||||
@Schema(description = "防御策略模板使用次数", example = "20", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private Integer usedTimes;
|
||||
|
||||
@JsonProperty("running_tasks")
|
||||
@Schema(description = "防御策略模板已运行的任务数量", example = "30", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private Integer runningTasks;
|
||||
|
||||
@JsonProperty("create_user_id")
|
||||
@Schema(description = "防御策略模板创建人ID", example = "1", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private Integer createUserId;
|
||||
|
||||
@JsonProperty("create_user_name")
|
||||
@Schema(description = "防御策略模板创建人名称", example = "xxx", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private String createUsername;
|
||||
|
||||
@JsonProperty("create_user_depart")
|
||||
@Schema(description = "防御策略模板创建人处室", example = "xxx", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private String createDepart;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user