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.BusyStateEnum;
import com.docus.server.enums.OnlineStateEnum;
import com.docus.server.enums.RestrictStateEnum;
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_terminator")
@ApiModel(value = "SchTerminator对象", description = "执行管理器")
public class SchTerminator implements Serializable {

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

    @ApiModelProperty(value = "终端IP")
    @TableField("terminator_ip")
    private String terminatorIp;

    @ApiModelProperty(value = "资源管理器名称")
    @TableField("terminator_name")
    private String terminatorName;

    @ApiModelProperty(value = "只干某些任务，任务偏好属性")
    @TableField("only_collector_ids")
    private String onlyCollectorIds;

    @ApiModelProperty(value = "优先干某些任务，任务偏好属性（优先给哪个采集器，若不空闲再给任意采集器）")
    @TableField("priority_collector_ids")
    private String priorityCollectorIds;

    @ApiModelProperty(value = "是否限制采集器类型，0：否，1：是")
    @TableField("restrict_state")
    private RestrictStateEnum restrictState;

    @ApiModelProperty(value = "忙闲状态，0：空闲，1：繁忙")
    @TableField("busy_state")
    private BusyStateEnum busyState;

    @ApiModelProperty(value = "在线状态，0：离线，1：在线")
    @TableField("online_state")
    private OnlineStateEnum onlineState;

    @ApiModelProperty(value = "最近任务执行时间")
    @TableField("last_task_exec_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastTaskExecTime;

    @ApiModelProperty(value = "正在执行任务的名称")
    @TableField("executing_task_name")
    private String executingTaskName;

    @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;


}
