package com.slodon.b2b2c.vo.statistics;

import com.slodon.b2b2c.core.util.FileUrlUtil;
import com.slodon.b2b2c.statistics.pojo.base.GoodsBase;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 *
 * 封装商品动销-商品收藏数排行VO对象
 * @author wuxy
 */
@Data
public class GoodsCollectionRankVO {

    @ApiModelProperty("商品id")
    private Long goodsId;

    @ApiModelProperty("商品名称")
    private String goodsName;

    @ApiModelProperty("商品图片")
    private String goodsImage;

    @ApiModelProperty("店铺id")
    private Long storeId;

    @ApiModelProperty("店铺名称")
    private String storeName;

    @ApiModelProperty("收藏数")
    private Integer collectionNum;

    @ApiModelProperty("商品价格")
    private BigDecimal goodsPrice;

    public GoodsCollectionRankVO(GoodsBase goodsBase) {
        this.goodsId = goodsBase.getGoodsId();
        this.goodsName = goodsBase.getGoodsName();
        this.goodsImage = FileUrlUtil.getFileUrl(goodsBase.getGoodsImage(), null);
        this.storeId = goodsBase.getStoreId();
        this.storeName = goodsBase.getStoreName();
        this.collectionNum = goodsBase.getCollectionNum();
        this.goodsPrice = goodsBase.getGoodsPrice();
    }
}
