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.yonge.cooleshow.bbs.enums.ArticleEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 文章评论
 */
@TableName("bbs_reply")
@ApiModel(value = "BbsReply对象", description = "文章评论")
public class BbsReply implements Serializable {
    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty("上级id")
    @TableField(value = "parent_id_")
    private Long parentId;

    @ApiModelProperty("文章id")
    @TableField(value = "article_id")
    @NotNull(message = "文章id不能为空")
    private Long articleId;

    @ApiModelProperty("评论者id")
    @TableField(value = "user_id_")
    private Long userId;

    @ApiModelProperty("评论内容")
    @TableField(value = "content_")
    @NotBlank(message = "评论内容不能为空")
    private String content;

    @ApiModelProperty("审核中:DOING，通过:PASS，驳回:REJECT")
    @TableField(value = "status_")
    private ArticleEnum status;

    @ApiModelProperty("评论日期 ")
    @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 getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getArticleId() {
        return articleId;
    }

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

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public ArticleEnum getStatus() {
        return status;
    }

    public void setStatus(ArticleEnum status) {
        this.status = status;
    }

    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;
    }
}