package com.yonge.cooleshow.bbs.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.fasterxml.jackson.annotation.JsonFormat;
import com.yonge.cooleshow.bbs.enums.ArticleEnum;
import com.yonge.cooleshow.bbs.valid.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@TableName("bbs_auth_record")
@ApiModel(value = "BbsAuthRecord对象", description = "文章审核表")
public class BbsAuthRecord implements Serializable {
    @TableId(value = "id_", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("文章id")
    @TableField(value = "article_id_")
    @NotNull(groups = {UpdateGroup.class}, message = "文章id不能为空")
    private Long articleId;

    @ApiModelProperty("审核者id")
    @TableField(value = "verify_user_id_")
    private Long verifyUserId;

    @ApiModelProperty("审核中:DOING，通过:PASS，驳回:REJECT")
    @TableField(value = "audit_state_")
    @NotNull(groups = {UpdateGroup.class}, message = "审核状态不能为空")
    private ArticleEnum auditState;

    @ApiModelProperty("审核理由")
    @TableField(value = "reason_")
    @NotBlank(groups = {UpdateGroup.class}, message = "审核理由不能为空")
    private String reason;

    @TableField(value = "created_time_")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @TableField(value = "updated_time_")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    public Long getId() {
        return id;
    }

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

    public Long getArticleId() {
        return articleId;
    }

    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }

    public Long getVerifyUserId() {
        return verifyUserId;
    }

    public void setVerifyUserId(Long verifyUserId) {
        this.verifyUserId = verifyUserId;
    }

    public ArticleEnum getAuditState() {
        return auditState;
    }

    public void setAuditState(ArticleEnum auditState) {
        this.auditState = auditState;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }
}