package com.docus.server.dto.scheduling.management.schcollectrecord;

import com.docus.server.enums.RetryTaskEnum;
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.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

/**
 * 采集记录表 EditDTO
 *
 * @author AutoGenerator
 * @since 2023-07-15
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel(value = "EditSchCollectRecordDTO对象", description = "采集记录表")
public class EditSchCollectRecordDTO implements Serializable {

    @ApiModelProperty(value = "主键")
    private Long id;

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

    @ApiModelProperty(value = "0：不是重试任务，1：是重试任务")
    private RetryTaskEnum isRetryTask;

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

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

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

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

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

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