关于学生知识点的树形结构展示
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/741b4df9b6027aabe9910535302d0fc2.png)
数据库存储格式如下:
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/ce76f3fb6efac03a704e09f86808a2ce.png)
代码实现如下:
categoryBean
private String id;
private int deletionFlag;
private String name;
private String parentId;
private int type;
private List<CategoryBean> child = new ArrayList<>();
.....set/get
/***** constructor *****/
public CategoryBean() {
}
public CategoryBean(Category category){
this(category.getId(),category.getDeletionFlag()
,category.getName(),category.getParentId(),category.getType());
}
public CategoryBean(String id, int deletionFlag, String name, String parentId, int type) {
this.id &