package top.tqx.demo_1.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName(value = "exam_paper", autoResultMap = true)
public class ExamPaper implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField(value = "paper_id")
    private String paperId;

    @TableField(value = "title")
    private String title;

    @TableField(value = "description")
    private String description;

    @TableField(value = "total_score")
    private BigDecimal totalScore;

    @TableField(value = "duration")
    private Integer duration;

    @TableField(value = "question_count")
    private Integer questionCount;

    @TableField(value = "status")
    private String status;

    @TableField(value = "permission_scope")
    private String permissionScope;

    @TableField(value = "dept_id")
    private Long deptId;

    @TableField(value = "question_ids", typeHandler = JacksonTypeHandler.class)
    private JsonNode questionIds;

    @TableField(value = "created_by")
    private Long createdBy;

    @TableField(value = "created_at")
    private LocalDateTime createdAt;

    @TableField(value = "updated_at")
    private LocalDateTime updatedAt;

    @TableField(value = "publish_time")
    private LocalDateTime publishTime;

    @TableField(value = "deadline")
    private LocalDateTime deadline;
}