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.util.UidUtil;
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_course", description = "考试科目")
public class TEExamCourse extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @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 = "course_name")
    private String courseName;

    @ApiModelProperty(value = "是否开启客观题乱序，0：不开启，1：开启")
    @TableField(value = "objective_shuffle")
    private Integer objectiveShuffle;

    @ApiModelProperty(value = "是否选项乱序，针对一个科目进行设置，0：不开启，1：开启")
    @TableField(value = "option_shuffle")
    private Integer optionShuffle;

    @ApiModelProperty(value = "已绑定试卷数量")
    @TableField(value = "paper_count")
    private Integer paperCount;

    @ApiModelProperty(value = "是否已补齐标答，0：否，1：是")
    @TableField(value = "has_answer")
    private Integer hasAnswer;

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

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

    @ApiModelProperty(value = "是否允许使用移动端拍照答题，0：不开启，1：开启")
    private Integer mobilePhotoUpload = 0;

    public TEExamCourse() {

    }

    public TEExamCourse(Long examId, String courseCode, String courseName, Long createId) {
        setId(UidUtil.nextId());
        this.examId = examId;
        this.courseCode = courseCode;
        this.courseName = courseName;
        setCreateId(createId);
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    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 getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public Integer getObjectiveShuffle() {
        return objectiveShuffle;
    }

    public void setObjectiveShuffle(Integer objectiveShuffle) {
        this.objectiveShuffle = objectiveShuffle;
    }

    public Integer getOptionShuffle() {
        return optionShuffle;
    }

    public void setOptionShuffle(Integer optionShuffle) {
        this.optionShuffle = optionShuffle;
    }

    public Integer getPaperCount() {
        return paperCount;
    }

    public void setPaperCount(Integer paperCount) {
        this.paperCount = paperCount;
    }

    public Integer getHasAnswer() {
        return hasAnswer;
    }

    public void setHasAnswer(Integer hasAnswer) {
        this.hasAnswer = hasAnswer;
    }

    public Integer getAudioPlayCount() {
        return audioPlayCount;
    }

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

    public Integer getHasAudio() {
        return hasAudio;
    }

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

    public Integer getMobilePhotoUpload() {
        return mobilePhotoUpload;
    }

    public void setMobilePhotoUpload(Integer mobilePhotoUpload) {
        this.mobilePhotoUpload = mobilePhotoUpload;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TEExamCourse that = (TEExamCourse) o;
        return Objects.equals(examId, that.examId) && Objects.equals(courseCode, that.courseCode) && Objects.equals(courseName, that.courseName) && Objects.equals(objectiveShuffle, that.objectiveShuffle) && Objects.equals(optionShuffle, that.optionShuffle) && Objects.equals(paperCount, that.paperCount) && Objects.equals(hasAnswer, that.hasAnswer) && Objects.equals(audioPlayCount, that.audioPlayCount) && Objects.equals(hasAudio, that.hasAudio) && Objects.equals(mobilePhotoUpload, that.mobilePhotoUpload);
    }

    @Override
    public int hashCode() {
        return Objects.hash(examId, courseCode, courseName, objectiveShuffle, optionShuffle, paperCount, hasAnswer, audioPlayCount, hasAudio, mobilePhotoUpload);
    }

    @Override
    public String toString() {
        return "TEExamCourse{" +
                "examId=" + examId +
                ", courseCode='" + courseCode + '\'' +
                ", courseName='" + courseName + '\'' +
                ", objectiveShuffle=" + objectiveShuffle +
                ", optionShuffle=" + optionShuffle +
                ", paperCount=" + paperCount +
                ", hasAnswer=" + hasAnswer +
                ", audioPlayCount=" + audioPlayCount +
                ", hasAudio=" + hasAudio +
                ", mobilePhotoUpload=" + mobilePhotoUpload +
                '}';
    }
}
