package cn.com.qmth.examcloud.tool.entity;

import cn.com.qmth.examcloud.tool.enums.TaskStatus;
import cn.com.qmth.examcloud.tool.enums.TaskType;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 任务表
 */
@Entity
@Table(name = "t_task")
public class TaskEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date creationTime;

    @Column(nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

    /**
     * 开始处理时间
     */
    @Column
    @Temporal(TemporalType.TIMESTAMP)
    private Date startTime;

    /**
     * 结束处理时间
     */
    @Column
    @Temporal(TemporalType.TIMESTAMP)
    private Date endTime;

    /**
     * 任务类型
     */
    @Enumerated(EnumType.STRING)
    @Column(length = 50, nullable = false)
    private TaskType type;

    /**
     * 任务状态
     */
    @Enumerated(EnumType.STRING)
    @Column(length = 50, nullable = false)
    private TaskStatus status;

    /**
     * 任务描述
     */
    @Lob
    @Column
    private String description;

    /**
     * 文件路径
     */
    @Column
    private String filePath;

    /**
     * 操作者ID
     */
    @Column
    private Long operatorId;

    /**
     * 操作者名称
     */
    @Column(length = 100)
    private String operatorName;

    /**
     * 用户Token
     */
    @Column(length = 100)
    private String userToken;

    /**
     * 考试ID
     */
    @Column
    private Long examId;

    /**
     * 参数信息（JSON格式）
     */
    @Column(length = 2000)
    private String params;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getCreationTime() {
        return creationTime;
    }

    public void setCreationTime(Date creationTime) {
        this.creationTime = creationTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public TaskType getType() {
        return type;
    }

    public void setType(TaskType type) {
        this.type = type;
    }

    public TaskStatus getStatus() {
        return status;
    }

    public void setStatus(TaskStatus status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public Long getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getUserToken() {
        return userToken;
    }

    public void setUserToken(String userToken) {
        this.userToken = userToken;
    }

    public Long getExamId() {
        return examId;
    }

    public void setExamId(Long examId) {
        this.examId = examId;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

}
