package cn.reghao.bnt.web.admin.model.vo;

import cn.reghao.bnt.web.admin.model.po.Menu;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author reghao
 * @date 2025-12-01 11:09:19
 */
@Setter
@Getter
public class ResourceTree {
    private int pid;
    private int id;
    private String name;
    private int pos;
    private List<ResourceTree> children;
    private String label;
    private int value;
    private String url;
    private String type;
    private String icon;

    public ResourceTree(Menu menu) {
        this.pid = menu.getPid();
        this.id = menu.getId();
        this.name = menu.getName();
        this.pos = menu.getPos();
        this.children = new ArrayList<>();
        this.value = menu.getId();
        this.label = menu.getName();
        this.url = menu.getUrl();
        this.type = menu.getType();
        this.icon = menu.getIcon();
    }
}
