@Test
public void testtree(){
//模拟从数据库查询出来
List
//获取父节点
List
@Data
@Builder
public class Menu {
public List
childList;
public Menu(Integer id, String name, Integer parentId) {
this.id = id;
this.name = name;
this.parentId = parentId;
}
public Menu(Integer id, String name, Integer parentId, List childList) {
this.id = id;
this.name = name;
this.parentId = parentId;
this.childList = childList;
}
}