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.YesOrNoEnum;
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_private_message")
@ApiModel(value = "BbsPrivateMessage对象", description = "私信")
public class BbsPrivateMessage implements Serializable {
    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty("发送用户id")
    @TableField(value = "send_user_id_")
    private Long sendUserId;

    @ApiModelProperty(value = "接受方用户id",required = true)
    @NotNull(message = "私信接收方id不能为空")
    @TableField(value = "receiver_user_id_")
    private Long receiverUserId;

    @ApiModelProperty(value = "发送消息内容",required = true)
    @NotBlank(message = "私信信息不能为空")
    @TableField(value = "message_content_")
    private String messageContent;

    @ApiModelProperty(value = "0:未读 1:已读")
    @TableField(value = "read_flag_")
    private YesOrNoEnum readFlag;

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

    public Long getId() {
        return id;
    }

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

    public Long getSendUserId() {
        return sendUserId;
    }

    public void setSendUserId(Long sendUserId) {
        this.sendUserId = sendUserId;
    }

    public Long getReceiverUserId() {
        return receiverUserId;
    }

    public void setReceiverUserId(Long receiverUserId) {
        this.receiverUserId = receiverUserId;
    }

    public String getMessageContent() {
        return messageContent;
    }

    public void setMessageContent(String messageContent) {
        this.messageContent = messageContent;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

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

    public YesOrNoEnum getReadFlag() {
        return readFlag;
    }

    public void setReadFlag(YesOrNoEnum readFlag) {
        this.readFlag = readFlag;
    }
}