首先树结构:
public class TreeVo {
private String label;
private List<TreeVo> children;
public TreeVo() {
}
public TreeVo(String label) {
this.label = label;
this.children = new ArrayList<>();
}
public TreeVo(String label, List<TreeVo> children) {
this.label = label;
this.children = children;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public List<TreeVo> getChildren() {
return children;
}
public void setChildren(List<TreeVo> children) {
this.children = children;
}
@Override
public String toString() {
return "TreeVo{" +
"label='" + label + '\'' +
", children=" + childre