1. 添加部分swagger文档

This commit is contained in:
EnderByEndera
2024-01-12 14:31:34 +08:00
parent 8f545110f1
commit c1a5d2462f
30 changed files with 614 additions and 65 deletions

View File

@@ -1,6 +1,8 @@
package com.realtime.protection.configuration.entity.task;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Future;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@@ -9,56 +11,72 @@ import java.time.LocalDateTime;
import java.util.List;
@Data
@Schema(description = "一个任务对象包含的所有信息")
public class Task {
@JsonProperty("task_id")
@Schema(description = "任务ID", accessMode = Schema.AccessMode.READ_ONLY)
private Long taskId;
@JsonProperty("task_name")
@NotNull(message = "task_name should not be empty. ")
@Schema(description = "任务名称", example = "静态任务")
private String taskName;
@JsonProperty("task_start_time")
@NotNull(message = "task_start_time should not be empty. ")
@Future(message = "task_start_time should be a future time")
@Schema(description = "任务开始时间,必须晚于当前时间", example = "2024-10-23T00:00:00")
private LocalDateTime taskStartTime;
@JsonProperty("task_end_time")
@NotNull(message = "task_end_time should not be empty. ")
@Future(message = "task_end_time should be a future time. ")
@Schema(description = "任务结束时间,必须晚于开始时间", example = "2024-10-24T00:00:00")
private LocalDateTime taskEndTime;
@JsonProperty("task_create_time")
@Schema(hidden = true)
private LocalDateTime taskCreateTime;
@JsonProperty("task_modify_time")
@Schema(hidden = true)
private LocalDateTime taskModifyTime;
@JsonProperty("task_type")
@NotNull(message = "task_type should not be empty. ")
@Schema(description = "任务类型1为静态任务2为实时任务3为研判后任务", example = "1")
private Integer taskType;
@JsonProperty("task_act")
@NotNull(message = "task_act should not be empty. ")
@Schema(description = "任务行为,目前只能为【阻断】", example = "阻断")
private String taskAct;
@JsonProperty("task_create_username")
@Schema(hidden = true)
private String taskCreateUsername;
@JsonProperty("task_create_depart")
@Schema(hidden = true)
private String taskCreateDepart;
@JsonProperty("task_create_userid")
@Schema(hidden = true)
private Long taskCreateUserId;
@JsonProperty("static_rule_ids")
@Schema(description = "静态规则ID列表动态和静态至少存在1个规则", example = "[10, 12]")
private List<Long> staticRuleIds;
@JsonProperty("dynamic_rule_ids")
@Schema(description = "动态规则ID列表动态和静态至少存在1个规则", example = "[20, 30]")
private List<Long> dynamicRuleIds;
@JsonProperty("task_status")
@Schema(description = "任务状态0为未启动1为生成中2为运行中3为暂停中4为已停止5为已结束6为失败", accessMode = Schema.AccessMode.READ_ONLY)
private Integer taskStatus;
@JsonProperty("task_audit_status")
@Schema(description = "任务审核状态0为未审核1为已退回2为已通过", accessMode = Schema.AccessMode.READ_ONLY)
private Integer taskAuditStatus;
}