package com.qmth.themis.business.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.themis.business.enums.ExceptionEnum;
import com.qmth.themis.business.enums.VerifyExceptionEnum;
import com.qmth.themis.business.util.UidUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @Description: 考试断点记录
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/6/25
 */
@ApiModel(value = "t_oe_exam_break_history", description = "考试断点记录")
public class TOeExamBreakHistory implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键")
    @TableId(value = "id")
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "考试记录ID")
    @TableField(value = "exam_record_id")
    private Long examRecordId;

    @ApiModelProperty(value = "断点发生时间")
    @TableField(value = "break_time")
    private Long breakTime;

    @ApiModelProperty(value = "断点判定原因")
    @TableField(value = "break_reason")
    private ExceptionEnum breakReason;

    @ApiModelProperty(value = "提交异常原因")
    @TableField(value = "resume_reason")
    private String resumeReason;

    @ApiModelProperty(value = "恢复候考时间")
    @TableField(value = "prepare_time")
    private Long prepareTime;

    @ApiModelProperty(value = "恢复开考时间")
    @TableField(value = "start_time")
    private Long startTime;

    @ApiModelProperty(value = "恢复开考身份验证结果")
    @TableField(value = "entry_authentication_result")
    private VerifyExceptionEnum entryAuthenticationResult;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "恢复开考身份验证记录ID")
    @TableField(value = "entry_authentication_id")
    private Long entryAuthenticationId;

    public TOeExamBreakHistory() {

    }

    public TOeExamBreakHistory(Long examRecordId, Long breakTime, ExceptionEnum breakReason, String resumeReason) {
        this.id = UidUtil.nextId();
        this.examRecordId = examRecordId;
        this.breakTime = breakTime;
        this.breakReason = breakReason;
        this.resumeReason = resumeReason;
    }

    public TOeExamBreakHistory(Long id, Long examRecordId, Long breakTime, ExceptionEnum breakReason,
            String resumeReason) {
        this.id = id;
        this.examRecordId = examRecordId;
        this.breakTime = breakTime;
        this.breakReason = breakReason;
        this.resumeReason = resumeReason;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

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

    public Long getExamRecordId() {
        return examRecordId;
    }

    public void setExamRecordId(Long examRecordId) {
        this.examRecordId = examRecordId;
    }

    public ExceptionEnum getBreakReason() {
        return breakReason;
    }

    public void setBreakReason(ExceptionEnum breakReason) {
        this.breakReason = breakReason;
    }

    public String getResumeReason() {
        return resumeReason;
    }

    public void setResumeReason(String resumeReason) {
        this.resumeReason = resumeReason;
    }

    public VerifyExceptionEnum getEntryAuthenticationResult() {
        return entryAuthenticationResult;
    }

    public void setEntryAuthenticationResult(VerifyExceptionEnum entryAuthenticationResult) {
        this.entryAuthenticationResult = entryAuthenticationResult;
    }

    public Long getEntryAuthenticationId() {
        return entryAuthenticationId;
    }

    public void setEntryAuthenticationId(Long entryAuthenticationId) {
        this.entryAuthenticationId = entryAuthenticationId;
    }

    public Long getBreakTime() {
        return breakTime;
    }

    public void setBreakTime(Long breakTime) {
        this.breakTime = breakTime;
    }

    public Long getPrepareTime() {
        return prepareTime;
    }

    public void setPrepareTime(Long prepareTime) {
        this.prepareTime = prepareTime;
    }

    public Long getStartTime() {
        return startTime;
    }

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