package com.slodon.b2b2c.vo.goods;

import com.slodon.b2b2c.goods.pojo.GoodsCategory;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 *
 * 封装榜单商品分类VO对象
 * @author wuxy
 */
@Data
public class RankGoodsCategoryVO {

    @ApiModelProperty("分类id")
    private Integer categoryId;

    @ApiModelProperty("分类名称")
    private String categoryName;

    @ApiModelProperty("父类ID")
    private Integer pid;

    @ApiModelProperty("分类级别: 1-一级，2-二级，3-三级")
    private Integer grade;

    @ApiModelProperty("子分类列表")
    private List<RankGoodsCategoryVO> children;

    public RankGoodsCategoryVO(GoodsCategory goodsCategory) {
        this.categoryId = goodsCategory.getCategoryId();
        this.categoryName = goodsCategory.getCategoryName();
        this.pid = goodsCategory.getPid();
        this.grade = goodsCategory.getGrade();
    }
}