api_tree.go 549 B

12345678910111213141516171819202122
  1. /*
  2. * @description: 树接口相关
  3. * @Author: CP
  4. * @Date: 2020-09-17 15:00:25
  5. * @FilePath: \construction_management\web\controllers\api_tree.go
  6. */
  7. package controllers
  8. // 文件夹目录 树结构
  9. func (c *ApiController) GetTreeJson() {
  10. // 获得层级文件夹
  11. // projectId, err := c.Ctx.Values().GetInt("projectId")
  12. // if err != nil {
  13. // projectId = 0
  14. // }
  15. TreeData := c.ServiceTree.GetAllProject(23)
  16. // Jsondata, _ := json.Marshal(TreeData)
  17. // fmt.Println(string(Jsondata))
  18. c.Ctx.JSON(TreeData) // or myjsonStruct{hello:"json}
  19. }