package com.slodon.b2b2c.vo.video;

import com.slodon.b2b2c.core.util.FileUrlUtil;
import com.slodon.b2b2c.video.pojo.VideoGoods;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 *
 * 封装视频商品VO对象
 * @author wuxy
 */
@Data
public class VideoGoodsVO implements Serializable {

    private static final long serialVersionUID = 888743034296703243L;
    @ApiModelProperty("视频id")
    private Integer videoId;

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

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

    @ApiModelProperty("商品广告语")
    private String goodsBrief;

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

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

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

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

    @ApiModelProperty("商品库存")
    private Integer goodsStock;

    @ApiModelProperty("点击次数")
    private Integer clickNum;

    @ApiModelProperty("货品id")
    private Long productId;

    public VideoGoodsVO(VideoGoods videoGoods) {
        this.videoId = videoGoods.getVideoId();
        this.goodsId = videoGoods.getGoodsId();
        this.goodsName = videoGoods.getGoodsName();
        this.goodsBrief = videoGoods.getGoodsBrief();
        this.goodsImage = FileUrlUtil.getFileUrl(videoGoods.getGoodsImage(), null);
        this.goodsPrice = videoGoods.getGoodsPrice();
        this.productId = videoGoods.getDefaultProductId();
    }
}
