package com.storlead.message.pojo.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.mybatis.entity.SysBaseField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 系统内部消息
 * </p>
 *
 * @author chenkq
 * @since 2024-04-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("inside_message_record")
@ApiModel(value="InsideMessageRecordEntity对象", description="系统内部消息")
public class InsideMessageRecordEntity extends SysBaseField {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "消息标题")
    private String title;

    @ApiModelProperty(value = "所属服务: 0：主应用，10：智能贸易，20：销售，30：otr，40：工资，50：项目，60：领存平台")
    private Long appId;

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

    @ApiModelProperty(value = "模板图标")
    private String messageIcon;

    @ApiModelProperty(value = "模板标签")
    private String messageTag;

    @ApiModelProperty(value = "回调地址")
    private String callbackUrl;

    @ApiModelProperty(value = "微信小程序回调地址")
    private String wxCallbackUrl;

    @ApiModelProperty(value = "发送人")
    private Long sendUserId;

    @ApiModelProperty(value = "归属人员")
    private Long ownerBy;

    @ApiModelProperty(value = "是否已读 0:未发送,1:已发送,2:撤回")
    private Integer status;

    @ApiModelProperty(value = "所属业务组")
    private Integer messageType;

    @ApiModelProperty(value = "细分消息类型(对应事件)")
    private Integer messageSubType;

    @ApiModelProperty(value = "定时发送时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime timerSendTime;

    @ApiModelProperty(value = "实际发送时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime actuallySendTime;


    public InsideMessageRecordEntity() {}

    public InsideMessageRecordEntity(String title, String content,String messageIcon,String messageTag,String callbackUrl, Long sendUserId, Integer status, Integer messageType) {
        this.title = title;
        this.content = content;
        this.messageTag = messageTag;
        this.messageIcon = messageIcon;
        this.callbackUrl = callbackUrl;
        this.sendUserId = sendUserId;
        this.status = status;
        this.messageType = messageType;
    }
}
