package com.ruoyi.jarvis.domain;

import org.springframework.data.annotation.Transient;

import java.util.Date;
import java.util.List;

/**
 *
 * @TableName xb_message
 */
public class XbMessage {
    /**
     *
     */
    private Integer id;

    /**
     *
     */
    private Date createDate;

    /**
     *
     */
    private String skuid;

    /**
     * 线报原消息
     */
    private String tipOriginalMessage;

    /**
     * 来源
     */
    private String fromWxid;

    /**
     * 线报消息首行内容
     */
    private String firstLine;

    /**
     * 第一个商品的标题
     */
    private String firstSkuName;

    /**
     * 第一个线报商品的价格
     */
    private Double firstPrice;

    public List<XbMessageItem> getChildren() {
        if (children == null) {
            children = new java.util.ArrayList<>();
        }
        return children;
    }

    public void setChildren(List<XbMessageItem> children) {
        this.children = children;
    }

    @Transient
    private List<XbMessageItem> children;

    /**
     *
     */
    public Integer getId() {
        return id;
    }

    /**
     *
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     *
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     *
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     *
     */
    public String getSkuid() {
        return skuid;
    }

    /**
     *
     */
    public void setSkuid(String skuid) {
        this.skuid = skuid;
    }

    /**
     * 线报原消息
     */
    public String getTipOriginalMessage() {
        return tipOriginalMessage;
    }

    /**
     * 线报原消息
     */
    public void setTipOriginalMessage(String tipOriginalMessage) {
        this.tipOriginalMessage = tipOriginalMessage;
    }

    /**
     * 来源
     */
    public String getFromWxid() {
        return fromWxid;
    }

    /**
     * 来源
     */
    public void setFromWxid(String fromWxid) {
        this.fromWxid = fromWxid;
    }

    /**
     * 线报消息首行内容
     */
    public String getFirstLine() {
        return firstLine;
    }

    /**
     * 线报消息首行内容
     */
    public void setFirstLine(String firstLine) {
        this.firstLine = firstLine;
    }

    /**
     * 第一个商品的标题
     */
    public String getFirstSkuName() {
        return firstSkuName;
    }

    /**
     * 第一个商品的标题
     */
    public void setFirstSkuName(String firstSkuName) {
        this.firstSkuName = firstSkuName;
    }

    /**
     * 第一个线报商品的价格
     */
    public Double getFirstPrice() {
        return firstPrice;
    }

    /**
     * 第一个线报商品的价格
     */
    public void setFirstPrice(Double firstPrice) {
        this.firstPrice = firstPrice;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        XbMessage other = (XbMessage) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getSkuid() == null ? other.getSkuid() == null : this.getSkuid().equals(other.getSkuid()))
            && (this.getTipOriginalMessage() == null ? other.getTipOriginalMessage() == null : this.getTipOriginalMessage().equals(other.getTipOriginalMessage()))
            && (this.getFromWxid() == null ? other.getFromWxid() == null : this.getFromWxid().equals(other.getFromWxid()))
            && (this.getFirstLine() == null ? other.getFirstLine() == null : this.getFirstLine().equals(other.getFirstLine()))
            && (this.getFirstSkuName() == null ? other.getFirstSkuName() == null : this.getFirstSkuName().equals(other.getFirstSkuName()))
            && (this.getFirstPrice() == null ? other.getFirstPrice() == null : this.getFirstPrice().equals(other.getFirstPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getSkuid() == null) ? 0 : getSkuid().hashCode());
        result = prime * result + ((getTipOriginalMessage() == null) ? 0 : getTipOriginalMessage().hashCode());
        result = prime * result + ((getFromWxid() == null) ? 0 : getFromWxid().hashCode());
        result = prime * result + ((getFirstLine() == null) ? 0 : getFirstLine().hashCode());
        result = prime * result + ((getFirstSkuName() == null) ? 0 : getFirstSkuName().hashCode());
        result = prime * result + ((getFirstPrice() == null) ? 0 : getFirstPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", createDate=").append(createDate);
        sb.append(", skuid=").append(skuid);
        sb.append(", tipOriginalMessage=").append(tipOriginalMessage);
        sb.append(", fromWxid=").append(fromWxid);
        sb.append(", firstLine=").append(firstLine);
        sb.append(", firstSkuName=").append(firstSkuName);
        sb.append(", firstPrice=").append(firstPrice);
        sb.append("]");
        return sb.toString();
    }
}
