package cn.reghao.tnb.search.esapp.blog.model.vo;

import cn.reghao.tnb.search.esapp.blog.model.po.Category;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author reghao
 * @date 2023-04-17 14:30:33
 */
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
public class CategoryCount {
    private int index;
    private int id;
    private String name;
    private int total;

    public CategoryCount(GroupCount groupCount) {
        this.id = groupCount.getId();
        this.name = groupCount.getName();
        this.total = groupCount.getTotal();
    }

    public CategoryCount(Category category) {
        this.id = category.getId();
        this.name = category.getName();
        this.total = 0;
    }
}
