package com.xinelu.manage.domain.personsubscribemessage;

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.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

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

/**
 * 泉医到家护理员微信小程序订阅消息记录对象 person_subscribe_message
 *
 * @author xinyilu
 * @date 2023-03-29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "泉医到家护理员微信小程序订阅消息记录对象", description = "person_subscribe_message")
public class PersonSubscribeMessage extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -2334006742704447358L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 护理员表id
     */
    @ApiModelProperty(value = "护理员表id")
    @Excel(name = "护理员表id")
    private Long nurseStationPersonId;

    /**
     * 微信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;

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

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

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

    /**
     * 订阅状态，accept：接受，reject：拒绝
     */
    @ApiModelProperty(value = "订阅状态，accept：接受，reject：拒绝")
    @Excel(name = "订阅状态，accept：接受，reject：拒绝")
    private String subscribeStatus;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PersonSubscribeMessage that = (PersonSubscribeMessage) o;
        return Objects.equals(openid, that.openid) && Objects.equals(templateId, that.templateId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(openid, templateId);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("nurseStationPersonId", getNurseStationPersonId())
                .append("unionid", getUnionid())
                .append("openid", getOpenid())
                .append("appletId", getAppletId())
                .append("templateId", getTemplateId())
                .append("messageType", getMessageType())
                .append("subscribeTime", getSubscribeTime())
                .append("subscribeStatus", getSubscribeStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
