package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 消息
 */
@Data
@JsonInclude
@TableName("life_message")
public class LifeMessage {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "发送人id （'user_'/'store_'/'lawyer_' + 手机号）")
    private String senderId;

    @TableField("sender_user_type")
    @ApiModelProperty(value = "发送人用户分类：1-用户 2-商户 3-律师")
    private Integer senderUserType;

    @TableField("sender_ref_id")
    @ApiModelProperty(value = "发送人对应表主键id（与 sender_user_type 对应）")
    private Integer senderRefId;

    @ApiModelProperty(value = "发送人姓名")
    private String senderName;

    @ApiModelProperty(value = "接收人id（'user_'/'store_'/'lawyer_' + 手机号）")
    private String receiverId;

    @TableField("receiver_user_type")
    @ApiModelProperty(value = "接收人用户分类：1-用户 2-商户 3-律师")
    private Integer receiverUserType;

    @TableField("receiver_ref_id")
    @ApiModelProperty(value = "接收人对应表主键id（与 receiver_user_type 对应）")
    private Integer receiverRefId;

    @ApiModelProperty(value = "接收人姓名")
    private String receiverName;

    @ApiModelProperty(value = "发送内容")
    private String content;

    @ApiModelProperty(value = "消息类型  1-文本  2-图片 3-链接  4-二手交易创建/确认/拒绝/取消  5-二手交易签到提醒  6-二手交易已签到  7-消息内容不合规  8-律师消息  9-二手交易修改交易请求  10-二手交易提醒进入实时定位  11-二手交易委托  12-二手交易是否与交易有关的言论温馨提示")
    private String type;

    private Date currentTime;

    @ApiModelProperty(value = "是否已读, 0:未读, 1:已读")
    private Integer isRead;

    @ApiModelProperty(value = "删除该条消息的phoneId，用逗号分隔")
    @TableField("delete_phone_id")
    private String deletePhoneId;

    @TableField("delete_phone_user_type")
    @ApiModelProperty(value = "删除方用户分类：1-用户 2-商户 3-律师")
    private Integer deletePhoneUserType;

    @TableField("delete_phone_ref_id")
    @ApiModelProperty(value = "删除方对应表主键id（与 delete_phone_user_type 对应）")
    private Integer deletePhoneRefId;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty(value = "修改人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty(value = "业务ID")
    @TableField("business_id")
    private Integer businessId;
}
