Java实现树结构以及计算各个节点数的和

  1. DeptPO

@Data
public class DeptPO {
    private Long id;
    private String name;
    private Long parentId;
    private Integer nums;
}
  1. DeptTree

@Data
public class DeptTree {
    private Long id;
    private String name;
    private Integer nums;
    private List childList;
}
  1. Test

你可能感兴趣的:(基础,java)