package com.xinelu.manage.domain.officialaccountsubscribeevent;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
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.time.LocalDateTime;

/**
 * 微信公众号关注和取消事件信息对象 official_account_subscribe_event
 *
 * @author xinelu
 * @date 2024-03-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "微信公众号关注和取消事件信息对象", description = "official_account_subscribe_event")
public class OfficialAccountSubscribeEvent extends BaseEntity {
    private static final long serialVersionUID = 4235213866159646854L;
    /**
     * 主键id
     */
    private Long id;

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

    /**
     * 微信公众号id
     */
    @ApiModelProperty(value = "微信公众号id")
    @Excel(name = "微信公众号id")
    private String officialAccountAppId;

    /**
     * 消息创建时间 ，yyyy-MM-dd HH:mm:ss
     */
    @ApiModelProperty(value = "消息创建时间 ，yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "消息创建时间 ，yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sendTime;

    /**
     * 消息类型是事件，固定取值为：event
     */
    @ApiModelProperty(value = "消息类型是事件，固定取值为：event")
    @Excel(name = "消息类型是事件，固定取值为：event")
    private String msgType;

    /**
     * 事件类型，订阅：subscribe，取消订阅：unsubscribe
     */
    @ApiModelProperty(value = "事件类型，订阅：subscribe，取消订阅：unsubscribe")
    @Excel(name = "事件类型，订阅：subscribe，取消订阅：unsubscribe")
    private String eventType;

    /**
     * 订阅状态，关注：FOCUS，取消：CANCEL
     */
    @ApiModelProperty(value = "订阅状态，关注：FOCUS，取消：CANCEL")
    @Excel(name = "订阅状态，关注：FOCUS，取消：CANCEL")
    private String subscribeStatus;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("openid", getOpenid())
                .append("officialAccountAppId", getOfficialAccountAppId())
                .append("sendTime", getSendTime())
                .append("msgType", getMsgType())
                .append("eventType", getEventType())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
