Skip to content

树表示例 ​

INF-DEMO-02 | 模块 infra | 演示父子结构(分类树)的生成结果与列表展示方式。

1. 使用角色与场景 ​

角色:开发者

  • 需要一个层级结构时参考此示例

2. 接口与权限点 ​

方法路径权限点摘要代码行
POST/infra/demo02-category/createinfra:demo02-category:create创建示例分类Demo02CategoryController#L37
PUT/infra/demo02-category/updateinfra:demo02-category:update更新示例分类Demo02CategoryController#L44
DELETE/infra/demo02-category/deleteinfra:demo02-category:delete删除示例分类Demo02CategoryController#L52
GET/infra/demo02-category/getinfra:demo02-category:query获得示例分类Demo02CategoryController#L61
GET/infra/demo02-category/listinfra:demo02-category:query获得示例分类列表Demo02CategoryController#L70
GET/infra/demo02-category/export-excelinfra:demo02-category:export导出示例分类 ExcelDemo02CategoryController#L78

3. 代码定位 ​

层位置
Controllermodules/infra/src/main/java/com/pmforge/module/infra/controller/admin/demo/demo02/Demo02CategoryController.java#L37
DOmodules/infra/src/main/java/com/pmforge/module/infra/dal/dataobject/demo/demo02/Demo02CategoryDO.java

4. 数据表 ​

表DO
pmforge_demo02_categoryDemo02CategoryDO

5. 机制与配置 ​

  • parent_id 自关联;列表接口返回整棵树

6. 常见问题与排查 ​

  • 移动节点时需校验不能挂到自己的子孙下

7. 关联 ​