package com.srs.comprehensive.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.srs.common.annotation.Excel;
import com.srs.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 消息对象 cph_msg
 * 
 * @author srs
 * @date 2023-07-12
 */
@Data
public class CphMsg
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /** 发送人用户id */
    @Excel(name = "发送人用户id")
    private Long sender;

    /** 收信人用户id */
    @Excel(name = "收信人用户id")
    private Long receiver;

    /** 消息内容 */
    @Excel(name = "消息内容")
    private String content;

    @TableField("create_by")
    private String createBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新者
     */
    @TableField("update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("sender", getSender())
            .append("receiver", getReceiver())
            .append("content", getContent())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
