package com.qmth.themis.business.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.themis.business.base.BaseEntity;
import com.qmth.themis.business.enums.EncryptModeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;

/**
 * @Description: 考试试卷
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/6/25
 */
@ApiModel(value = "t_e_exam_paper", description = "考试试卷")
public class TEExamPaper extends BaseEntity {

    /**
     *
     */
    private static final long serialVersionUID = -3182356952124087406L;

    @ApiModelProperty(value = "试卷名称")
    @TableField(value = "name")
    private String name;

    @ApiModelProperty(value = "试卷总分")
    @TableField(value = "total_score")
    private Double totalScore;

    @ApiModelProperty(value = "试卷客观题总分")
    @TableField(value = "total_objective_score")
    private Double totalObjectiveScore;

    @ApiModelProperty(value = "试卷主观题总分")
    @TableField(value = "total_subjective_score")
    private Double totalSubjectiveScore;

    @ApiModelProperty(value = "题干路径")
    @TableField(value = "paper_path")
    private String paperPath;

    @ApiModelProperty(value = "题干md5")
    @TableField(value = "paper_md5")
    private String paperMd5;

    @ApiModelProperty(value = "阅卷用试卷json路径")
    @TableField(value = "paper_view_path")
    private String paperViewPath;

    @ApiModelProperty(value = "解密密钥")
    @TableField(value = "decrypt_secret")
    private String decryptSecret;

    @ApiModelProperty(value = "auto：自动，hand：手动")
    @TableField(value = "encrypt_mode")
    private EncryptModeEnum encryptMode;

    @ApiModelProperty(value = "是否需要语音作答，0：不需要，1：需要")
    @TableField(value = "need_voice_answer")
    private Integer needVoiceAnswer;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "批次id")
    @TableField(value = "exam_id")
    private Long examId;

    @ApiModelProperty(value = "科目编码")
    @TableField(value = "course_code")
    private String courseCode;

    @ApiModelProperty(value = "试卷编码")
    @TableField(value = "code")
    private String code;

    @ApiModelProperty(value = "标答路径")
    @TableField(value = "answer_path")
    private String answerPath;

    @ApiModelProperty(value = "题干包含音频，0：不包含，1：包含")
    @TableField(value = "has_audio")
    private Integer hasAudio;

    @ApiModelProperty(value = "调卷比例")
    @TableField(value = "weight")
    private Double weight;

    @ApiModelProperty(value = "音频播放次数")
    @TableField(value = "audio_play_count")
    private Integer audioPlayCount;

    @ApiModelProperty(value = "结构文件路径")
    @TableField(value = "struct_path")
    private String structPath;

    @ApiModelProperty(value = "结构文件md5")
    @TableField(value = "struct_md5")
    private String structMd5;

    @ApiModelProperty(value = "解密向量")
    @TableField(value = "decrypt_vector")
    private String decryptVector;

    public String getStructPath() {
        return structPath;
    }

    public void setStructPath(String structPath) {
        this.structPath = structPath;
    }

    public String getDecryptVector() {
        return decryptVector;
    }

    public void setDecryptVector(String decryptVector) {
        this.decryptVector = decryptVector;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(Double totalScore) {
        this.totalScore = totalScore;
    }

    public String getPaperPath() {
        return paperPath;
    }

    public void setPaperPath(String paperPath) {
        this.paperPath = paperPath;
    }

    public String getDecryptSecret() {
        return decryptSecret;
    }

    public void setDecryptSecret(String decryptSecret) {
        this.decryptSecret = decryptSecret;
    }

    public EncryptModeEnum getEncryptMode() {
        return encryptMode;
    }

    public void setEncryptMode(EncryptModeEnum encryptMode) {
        this.encryptMode = encryptMode;
    }

    public Integer getNeedVoiceAnswer() {
        return needVoiceAnswer;
    }

    public void setNeedVoiceAnswer(Integer needVoiceAnswer) {
        this.needVoiceAnswer = needVoiceAnswer;
    }

    public Long getExamId() {
        return examId;
    }

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

    public String getCourseCode() {
        return courseCode;
    }

    public void setCourseCode(String courseCode) {
        this.courseCode = courseCode;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAnswerPath() {
        return answerPath;
    }

    public void setAnswerPath(String answerPath) {
        this.answerPath = answerPath;
    }

    public Integer getHasAudio() {
        return hasAudio;
    }

    public void setHasAudio(Integer hasAudio) {
        this.hasAudio = hasAudio;
    }

    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    public Integer getAudioPlayCount() {
        return audioPlayCount;
    }

    public void setAudioPlayCount(Integer audioPlayCount) {
        this.audioPlayCount = audioPlayCount;
    }

    public String getPaperViewPath() {
        return paperViewPath;
    }

    public void setPaperViewPath(String paperViewPath) {
        this.paperViewPath = paperViewPath;
    }

    public Double getTotalObjectiveScore() {
        return totalObjectiveScore;
    }

    public void setTotalObjectiveScore(Double totalObjectiveScore) {
        this.totalObjectiveScore = totalObjectiveScore;
    }

    public Double getTotalSubjectiveScore() {
        return totalSubjectiveScore;
    }

    public void setTotalSubjectiveScore(Double totalSubjectiveScore) {
        this.totalSubjectiveScore = totalSubjectiveScore;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getPaperMd5() {
        return paperMd5;
    }

    public void setPaperMd5(String paperMd5) {
        this.paperMd5 = paperMd5;
    }

    public String getStructMd5() {
        return structMd5;
    }

    public void setStructMd5(String structMd5) {
        this.structMd5 = structMd5;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TEExamPaper that = (TEExamPaper) o;
        return Objects.equals(name, that.name) && Objects.equals(totalScore, that.totalScore) && Objects.equals(totalObjectiveScore, that.totalObjectiveScore) && Objects.equals(totalSubjectiveScore, that.totalSubjectiveScore) && Objects.equals(paperPath, that.paperPath) && Objects.equals(paperMd5, that.paperMd5) && Objects.equals(paperViewPath, that.paperViewPath) && Objects.equals(decryptSecret, that.decryptSecret) && encryptMode == that.encryptMode && Objects.equals(needVoiceAnswer, that.needVoiceAnswer) && Objects.equals(examId, that.examId) && Objects.equals(courseCode, that.courseCode) && Objects.equals(code, that.code) && Objects.equals(answerPath, that.answerPath) && Objects.equals(hasAudio, that.hasAudio) && Objects.equals(weight, that.weight) && Objects.equals(audioPlayCount, that.audioPlayCount) && Objects.equals(structPath, that.structPath) && Objects.equals(structMd5, that.structMd5) && Objects.equals(decryptVector, that.decryptVector);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, totalScore, totalObjectiveScore, totalSubjectiveScore, paperPath, paperMd5, paperViewPath, decryptSecret, encryptMode, needVoiceAnswer, examId, courseCode, code, answerPath, hasAudio, weight, audioPlayCount, structPath, structMd5, decryptVector);
    }


}
