package com.ruoyi.interfaces.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.domain.TreeSelect;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

public class TreeSelectString  implements Serializable{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private String id;

    /** 节点名称 */
    private String label;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<TreeSelectString> children;

    public TreeSelectString(MdDataCate menu)
    {
        this.id = menu.getCateId();
        this.label = menu.getItemName();
        this.children = menu.getChildren().stream().map(TreeSelectString::new).collect(Collectors.toList());
    }

    public TreeSelectString(String id, String label, List<TreeSelectString> children) {
        this.id = id;
        this.label = label;
        this.children = children;
    }

    public TreeSelectString() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public List<TreeSelectString> getChildren() {
        return children;
    }

    public void setChildren(List<TreeSelectString> children) {
        this.children = children;
    }
}
