package com.docus.server.entity.scheduling.management;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.docus.server.enums.StateEnum;
import com.docus.server.enums.SubStateEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * 采集记录表重试表
 *
 * @author AutoGenerator
 * @since 2023-07-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sch_collect_record_retry_log")
@ApiModel(value = "SchCollectRecordRetryLog对象", description = "采集记录表重试表")
public class SchCollectRecordRetryLog implements Serializable {

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private Long id;

    @ApiModelProperty(value = "采集记录表id")
    @TableField("collect_record_id")
    private Long collectRecordId;

    @ApiModelProperty(value = "终端主键")
    @TableField("terminator_id")
    private Long terminatorId;

    @ApiModelProperty(value = "采集器id")
    @TableField("collector_id")
    private Long collectorId;

    @ApiModelProperty(value = "任务id")
    @TableField("task_id")
    private Long taskId;

    @ApiModelProperty(value = "任务名称")
    @TableField("task_name")
    private String taskName;

    @ApiModelProperty(value = "任务描述")
    @TableField("task_memo")
    private String taskMemo;

    @ApiModelProperty(value = "任务起始时间范围")
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @ApiModelProperty(value = "任务结束时间范围")
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @ApiModelProperty(value = "任务耗时时间,单位：毫秒")
    @TableField("elapsed_time")
    private Long elapsedTime;

    @ApiModelProperty(value = "任务详细信息")
    @TableField("task_detail_info")
    private String taskDetailInfo;

    @ApiModelProperty(value = "任务执行状态，0：成功，1：失败")
    @TableField("task_exec_state")
    private StateEnum taskExecState;

    @ApiModelProperty(value = "子任务执行状态：0：接收，1：启动，2：异常，3：推迟，4：完成，5：作废")
    @TableField("sub_task_exec_state")
    private SubStateEnum subTaskExecState;

    @ApiModelProperty(value = "最近一次任务执行失败原因")
    @TableField("last_task_error_msg")
    private String lastTaskErrorMsg;

    @ApiModelProperty(value = "入库时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "入库更新时间")
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty(value = "redis队列任务原始报文")
    @TableField("task_origin_json")
    private String taskOriginJson;
}
