课程咨询 :186 8716 1620      qq:2066486918

昆明Java培训 > 达内新闻 > java培训:生成树的结构
  • java培训:生成树的结构

    发布:昆明Java培训      来源:达内新闻      时间:2016-10-19

  • 昆明Java培训的老师今天给大家讲生成树的结构。

    生成树的结构示例:菜单树JSON

    {

    "success": true,

    "message": "请求成功",

    "data": [

    {

    "id": "1",

    "menuName": "系统管理",

    "menuType": 1,

    "menuCode": "sys",

    "parentId": "0",

    "sortNo": 50,

    "expand": 0,

    "isShow": 1,

    "permission": "sys",

    "comt": "test",

    "enable": 1,

    "iconcls": "fa fa-angle-right",

    "request": "#",

    "children": [

    {

    "id": "16",

    "menuName": "用户角色",

    "menuType": 1,

    "menuCode": "user.role",

    "parentId": "1",

    "sortNo": 11,

    "expand": 0,

    "isShow": 0,

    "permission": "user.role",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-users",

    "request": "app.sys.userroles",

    "children": null,

    "name": "用户角色"

    },

    {

    "id": "17",

    "menuName": "权限管理",

    "menuType": 1,

    "menuCode": "sys.access",

    "parentId": "1",

    "sortNo": 12,

    "expand": 0,

    "isShow": 1,

    "permission": "sys.access",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-list",

    "request": "app.sys.auth",

    "children": null,

    "name": "权限管理"

    },

    {

    "id": "18",

    "menuName": "系统日志",

    "menuType": 1,

    "menuCode": "sys.syslog",

    "parentId": "1",

    "sortNo": 22,

    "expand": 1,

    "isShow": 1,

    "permission": "sys.syslog",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-list",

    "request": "app.syslog",

    "children": null,

    "name": "系统日志"

    },

    {

    "id": "19",

    "menuName": "业务日志",

    "menuType": 1,

    "menuCode": "sys.log.business",

    "parentId": "1",

    "sortNo": 999,

    "expand": 1,

    "isShow": 1,

    "permission": "sys.log.business",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-list",

    "request": "app.businesslog",

    "children": null,

    "name": "业务日志"

    },

    {

    "id": "2",

    "menuName": "用户管理",

    "menuType": 1,

    "menuCode": "sys.user",

    "parentId": "1",

    "sortNo": 1,

    "expand": 0,

    "isShow": 1,

    "permission": "sys.user",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-user",

    "request": "app.user",

    "children": null,

    "name": "用户管理"

    },

    {

    "id": "3",

    "menuName": "部门管理",

    "menuType": 1,

    "menuCode": "sys.dept",

    "parentId": "1",

    "sortNo": 2,

    "expand": 0,

    "isShow": 1,

    "permission": "sys.dept",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-users",

    "request": "app.dept",

    "children": null,

    "name": "部门管理"

    },

    {

    "id": "4",

    "menuName": "菜单管理",

    "menuType": 1,

    "menuCode": "sys.menu",

    "parentId": "1",

    "sortNo": 3,

    "expand": 0,

    "isShow": 1,

    "permission": "sys.menu",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-bars",

    "request": "app.menu",

    "children": null,

    "name": "菜单管理"

    },

    {

    "id": "5",

    "menuName": "角色管理",

    "menuType": 1,

    "menuCode": "sys.role",

    "parentId": "1",

    "sortNo": 4,

    "expand": 0,

    "isShow": 1,

    "permission": "sys.role",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-cog",

    "request": "app.role",

    "children": null,

    "name": "角色管理"

    },

    {

    "id": "6",

    "menuName": "会话管理",

    "menuType": 1,

    "menuCode": "sys.session",

    "parentId": "1",

    "sortNo": 6,

    "expand": 0,

    "isShow": 0,

    "permission": "sys.session",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-list",

    "request": "main.sys.session.list",

    "children": null,

    "name": "会话管理"

    },

    {

    "id": "7",

    "menuName": "字典管理",

    "menuType": 1,

    "menuCode": "sys.dic",

    "parentId": "1",

    "sortNo": 7,

    "expand": 0,

    "isShow": 1,

    "permission": "sys.dic",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-book",

    "request": "app.dictindex",

    "children": null,

    "name": "字典管理"

    },

    {

    "id": "8",

    "menuName": "业务参数",

    "menuType": 1,

    "menuCode": "sys.param",

    "parentId": "1",

    "sortNo": 8,

    "expand": 0,

    "isShow": 0,

    "permission": "sys.param",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-wrench",

    "request": "main.sys.param.list",

    "children": null,

    "name": "业务参数"

    },

    {

    "id": "20",

    "menuName": "数据权限",

    "menuType": 1,

    "menuCode": "sys.dataauth",

    "parentId": "1",

    "sortNo": 20,

    "expand": 1,

    "isShow": 1,

    "permission": "sys.dataauth",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-users",

    "request": "app.dataauth",

    "children": null,

    "name": "数据权限"

    }

    ],

    "name": "系统管理"

    },

    {

    "id": "9",

    "menuName": "调度中心",

    "menuType": 1,

    "menuCode": "task",

    "parentId": "0",

    "sortNo": 2,

    "expand": 0,

    "isShow": 0,

    "permission": "task",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-angle-right",

    "request": "#",

    "children": [

    {

    "id": "10",

    "menuName": "任务组管理",

    "menuType": 1,

    "menuCode": "task.group",

    "parentId": "9",

    "sortNo": 1,

    "expand": 0,

    "isShow": 0,

    "permission": "task.group",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-tasks",

    "request": "main.task.group.list",

    "children": null,

    "name": "任务组管理"

    },

    {

    "id": "11",

    "menuName": "任务管理",

    "menuType": 1,

    "menuCode": "task.scheduler",

    "parentId": "9",

    "sortNo": 2,

    "expand": 0,

    "isShow": 0,

    "permission": "task.scheduler",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-table",

    "request": "main.task.scheduler.list",

    "children": null,

    "name": "任务管理"

    },

    {

    "id": "12",

    "menuName": "调度管理",

    "menuType": 1,

    "menuCode": "task.scheduled",

    "parentId": "9",

    "sortNo": 3,

    "expand": 0,

    "isShow": 0,

    "permission": "task.scheduled",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-user",

    "request": "main.task.scheduled.list",

    "children": null,

    "name": "调度管理"

    },

    {

    "id": "13",

    "menuName": "调度日志",

    "menuType": 1,

    "menuCode": "task.log",

    "parentId": "9",

    "sortNo": 4,

    "expand": 0,

    "isShow": 0,

    "permission": "task.log",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-list",

    "request": "main.task.log.list",

    "children": null,

    "name": "调度日志"

    },

    {

    "id": "15",

    "menuName": "角色权限",

    "menuType": 1,

    "menuCode": "role.access",

    "parentId": "9",

    "sortNo": 11,

    "expand": 1,

    "isShow": 1,

    "permission": "role.access",

    "comt": null,

    "enable": 1,

    "iconcls": "fa fa-list",

    "request": "app.sys.roleaccess",

    "children": null,

    "name": "角色权限"

    }

    ],

    "name": "调度中心"

    }

    ]

    }

    至此,可以方便实现树结构JSON的返回。

    学Java开发就到昆明达内Java培训班!了解详情请登陆昆明达内Java培训官网(km.Java.tedu.cn)!

    推荐文章

上一篇:Java培训:一个树型通用接口

下一篇:java培训:提倡异常封装

最新开班日期  |  更多

Java--零基础全日制班

Java--零基础全日制班

开班日期:11/30

Java--零基础业余班

Java--零基础业余班

开班日期:11/30

Java--周末提升班

Java--周末提升班

开班日期:11/30

Java--零基础周末班

Java--零基础周末班

开班日期:11/30

  • 网址:http://km .java.tedu.cn      地址:昆明市官渡区春城路62号证券大厦附楼6楼
  • 课程培训电话:186 8716 1620      qq:2066486918    全国服务监督电话:400-827-0010
  • 服务邮箱 ts@tedu.cn
  • 2001-2016 达内国际公司(TARENA INTERNATIONAL,INC.) 版权所有 京ICP证08000853号-56