package com.mortals.xhx.module.product.model;
import java.util.List;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.product.model.vo.ProductVo;
import com.mortals.xhx.module.product.model.ProductQuestionEntity;
import lombok.Data;
/**
* 产品实体对象
*
* @author zxfei
* @date 2023-09-18
*/
@Data
public class ProductEntity extends ProductVo {
    private static final long serialVersionUID = 1L;

    /**
    * 产品名称，名称唯一
    */
    @Excel(name = "产品名称，名称唯一")
    private String productName;
    /**
    * 产品编码
    */
    private String productCode;
    /**
    * 产品slogan
    */
    private String productSlogan;
    /**
    * 产品图标
    */
    private String productLogoPath;
    /**
    * 产品封面图片
    */
    private String productFacePath;
    /**
    * 产品视频,多个视频逗号分割
    */
    private String productVideoPath;
    /**
    * 产品宣传图片,多个视频逗号分割
    */
    private String productPicPath;
    /**
    * 产品介绍
    */
    private String productIntroduction;
    /**
    * 产品详情
    */
    private String productDetail;
    /**
    * 发布时间
    */
    private Date publishTime;
    /**
    * 是否热门(0.否,1.是)
    */
    private Integer hot;
    /**
    * 备注
    */
    private String productRemark;
    /**
    * 产品常见问题信息
    */
    private List<ProductQuestionEntity> productQuestionList=new ArrayList<>();;
    public List<ProductQuestionEntity> getProductQuestionList(){
      return productQuestionList;
    }

    public void setProductQuestionList(List<ProductQuestionEntity> productQuestionList){
        this.productQuestionList = productQuestionList;
    }
    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof ProductEntity) {
            ProductEntity tmp = (ProductEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
            this.productName = "";
            this.productCode = "";
            this.productSlogan = "";
            this.productLogoPath = "";
            this.productFacePath = "";
            this.productVideoPath = "";
            this.productPicPath = "";
            this.productIntroduction = "";
            this.productDetail = "";
            this.publishTime = new Date();
            this.hot = 0;
            this.productRemark = "";
    }
}