package com.macro.mall.search.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 搜索中的商品信息
 * Created by macro on 2018/6/19.
 */
@Document(indexName = "pms", type = "product",shards = 1,replicas = 0)
public class EsProduct implements Serializable {
    private static final long serialVersionUID = -1L;
    @Id
    private Long id;
    @Field(type = FieldType.Keyword)
    private String productSn;
    private Long brandId;
    @Field(type = FieldType.Keyword)
    private String brandName;
    private Long productCategoryId;
    @Field(type = FieldType.Keyword)
    private String productCategoryName;
    private String pic;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String name;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String subTitle;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String keywords;
    private BigDecimal price;
    private Integer sale;
    private Integer newStatus;
    private Integer recommandStatus;
    private Integer stock;
    private Integer promotionType;
    private Integer sort;
    @Field(type =FieldType.Nested)
    private List<EsProductAttributeValue> attrValueList;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getProductSn() {
        return productSn;
    }

    public void setProductSn(String productSn) {
        this.productSn = productSn;
    }

    public Long getBrandId() {
        return brandId;
    }

    public void setBrandId(Long brandId) {
        this.brandId = brandId;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public Long getProductCategoryId() {
        return productCategoryId;
    }

    public void setProductCategoryId(Long productCategoryId) {
        this.productCategoryId = productCategoryId;
    }

    public String getProductCategoryName() {
        return productCategoryName;
    }

    public void setProductCategoryName(String productCategoryName) {
        this.productCategoryName = productCategoryName;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSubTitle() {
        return subTitle;
    }

    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getSale() {
        return sale;
    }

    public void setSale(Integer sale) {
        this.sale = sale;
    }

    public Integer getNewStatus() {
        return newStatus;
    }

    public void setNewStatus(Integer newStatus) {
        this.newStatus = newStatus;
    }

    public Integer getRecommandStatus() {
        return recommandStatus;
    }

    public void setRecommandStatus(Integer recommandStatus) {
        this.recommandStatus = recommandStatus;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getPromotionType() {
        return promotionType;
    }

    public void setPromotionType(Integer promotionType) {
        this.promotionType = promotionType;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public List<EsProductAttributeValue> getAttrValueList() {
        return attrValueList;
    }

    public void setAttrValueList(List<EsProductAttributeValue> attrValueList) {
        this.attrValueList = attrValueList;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }
}

@@ -32,16 +32,69 @@
 omain;%0A%0A
+import lombok.Data;%0Aimport lombok.EqualsAndHashCode;%0A
 import o
@@ -132,16 +132,16 @@
 ion.Id;%0A
-
 import o
@@ -471,16 +471,60 @@
 19.%0A */%0A
+@Data%0A@EqualsAndHashCode(callSuper = false)%0A
 @Documen
@@ -1522,16 +1522,16 @@
 Nested)%0A
+
     priv
@@ -1582,2893 +1582,7 @@
 ist;
-%0A%0A    public Long getId() %7B%0A        return id;%0A    %7D%0A%0A    public void setId(Long id) %7B%0A        this.id = id;%0A    %7D%0A%0A    public String getProductSn() %7B%0A        return productSn;%0A    %7D%0A%0A    public void setProductSn(String productSn) %7B%0A        this.productSn = productSn;%0A    %7D%0A%0A    public Long getBrandId() %7B%0A        return brandId;%0A    %7D%0A%0A    public void setBrandId(Long brandId) %7B%0A        this.brandId = brandId;%0A    %7D%0A%0A    public String getBrandName() %7B%0A        return brandName;%0A    %7D%0A%0A    public void setBrandName(String brandName) %7B%0A        this.brandName = brandName;%0A    %7D%0A%0A    public Long getProductCategoryId() %7B%0A        return productCategoryId;%0A    %7D%0A%0A    public void setProductCategoryId(Long productCategoryId) %7B%0A        this.productCategoryId = productCategoryId;%0A    %7D%0A%0A    public String getProductCategoryName() %7B%0A        return productCategoryName;%0A    %7D%0A%0A    public void setProductCategoryName(String productCategoryName) %7B%0A        this.productCategoryName = productCategoryName;%0A    %7D%0A%0A    public String getPic() %7B%0A        return pic;%0A    %7D%0A%0A    public void setPic(String pic) %7B%0A        this.pic = pic;%0A    %7D%0A%0A    public String getName() %7B%0A        return name;%0A    %7D%0A%0A    public void setName(String name) %7B%0A        this.name = name;%0A    %7D%0A%0A    public String getSubTitle() %7B%0A        return subTitle;%0A    %7D%0A%0A    public void setSubTitle(String subTitle) %7B%0A        this.subTitle = subTitle;%0A    %7D%0A%0A    public BigDecimal getPrice() %7B%0A        return price;%0A    %7D%0A%0A    public void setPrice(BigDecimal price) %7B%0A        this.price = price;%0A    %7D%0A%0A    public Integer getSale() %7B%0A        return sale;%0A    %7D%0A%0A    public void setSale(Integer sale) %7B%0A        this.sale = sale;%0A    %7D%0A%0A    public Integer getNewStatus() %7B%0A        return newStatus;%0A    %7D%0A%0A    public void setNewStatus(Integer newStatus) %7B%0A        this.newStatus = newStatus;%0A    %7D%0A%0A    public Integer getRecommandStatus() %7B%0A        return recommandStatus;%0A    %7D%0A%0A    public void setRecommandStatus(Integer recommandStatus) %7B%0A        this.recommandStatus = recommandStatus;%0A    %7D%0A%0A    public Integer getStock() %7B%0A        return stock;%0A    %7D%0A%0A    public void setStock(Integer stock) %7B%0A        this.stock = stock;%0A    %7D%0A%0A    public Integer getPromotionType() %7B%0A        return promotionType;%0A    %7D%0A%0A    public void setPromotionType(Integer promotionType) %7B%0A        this.promotionType = promotionType;%0A    %7D%0A%0A    public Integer getSort() %7B%0A        return sort;%0A    %7D%0A%0A    public void setSort(Integer sort) %7B%0A        this.sort = sort;%0A    %7D%0A%0A    public List%3CEsProductAttributeValue%3E getAttrValueList() %7B%0A        return attrValueList;%0A    %7D%0A%0A    public void setAttrValueList(List%3CEsProductAttributeValue%3E attrValueList) %7B%0A        this.attrValueList = attrValueList;%0A    %7D%0A%0A    public String getKeywords() %7B%0A        return keywords;%0A    %7D%0A%0A    public void setKeywords(String keywords) %7B%0A        this.keywords = keywords;%0A    %7D
 %0A%7D%0A

Update EsProduct.java