package com.xinelu.manage.domain.subscribemessagesendrecord;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 微信小程序订阅消息发送结果记录对象 subscribe_message_send_record
 *
 * @author xinyilu
 * @date 2023-03-16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "微信小程序订阅消息发送结果记录对象", description = "subscribe_message_send_record")
public class SubscribeMessageSendRecord extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 4503696547761494422L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 微信unionid
     */
    @ApiModelProperty(value = "微信unionid")
    @Excel(name = "微信unionid")
    private String unionid;

    /**
     * 微信openid
     */
    @ApiModelProperty(value = "微信openid")
    @Excel(name = "微信openid")
    private String openid;

    /**
     * 微信小程序id
     */
    @ApiModelProperty(value = "微信小程序id")
    @Excel(name = "微信小程序id")
    private String appletId;

    /**
     * 订阅消息发送时间
     */
    @ApiModelProperty(value = "订阅消息发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "订阅消息发送时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime subscribeTime;

    /**
     * 消息模板id
     */
    @ApiModelProperty(value = "消息模板id")
    @Excel(name = "消息模板id")
    private String templateId;

    /**
     * 消息id
     */
    @ApiModelProperty(value = "消息id")
    @Excel(name = "消息id")
    private String msgId;

    /**
     * 订阅消息类型，预约服务付款通知提醒：APPOINT_ORDER_MESSAGE_PUSH，优惠券领取提醒：COUPON_RECEIVE_MESSAGE_PUSH，商品订单支付成功提醒：GOODS_ORDER_MESSAGE_PUSH
     */
    @ApiModelProperty(value = "订阅消息类型")
    @Excel(name = "订阅消息类型")
    private String messageType;

    /**
     * 推送结果状态码（0表示成功）
     */
    @ApiModelProperty(value = "推送结果状态码")
    @Excel(name = "推送结果状态码", readConverterExp = "0=表示成功")
    private Integer errorCode;

    /**
     * 推送结果状态码，success：成功
     */
    @ApiModelProperty(value = "推送结果状态码，success：成功")
    @Excel(name = "推送结果状态码，success：成功")
    private String errorStatus;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("unionid", getUnionid())
                .append("openid", getOpenid())
                .append("appletId", getAppletId())
                .append("subscribeTime", getSubscribeTime())
                .append("templateId", getTemplateId())
                .append("msgId", getMsgId())
                .append("errorCode", getErrorCode())
                .append("errorStatus", getErrorStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
