qq_28285633
2018-09-17 08:25
采纳率: 100%
浏览 1.2k

java 多层嵌套问题!!

数据库查询出的数据

将数据库查出数据拼装成以下格式的json:
{"models":[
{"modelname":"首页","modelurl":"/home","modelid":371,"fatherid":0,"nextModel":[],
"permissions":[
{"permissionid": 47,"permissionname": "首页","permissionclassic": "菜单"},
{ "permissionid": 49,"permissionname": "个人中心","permissionclassic": "菜单"}
]},
{"modelname":"首页","modelurl":"/home","modelid":371,"fatherid":0,
"nextModel":[{"modelname":"首页","modelurl":"/home","modelid":371,"fatherid":371},
{"modelname":"首页","modelurl":"/home","modelid":371,"fatherid":371,"nextModel":[],
"permissions":[
{"permissionid": 47,"permissionname": "首页","permissionclassic": "菜单"},
{"permissionid": 47,"permissionname": "首页","permissionclassic": "菜单"}
]}],"permissions":[]
}
]}

头都绕晕了
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

6条回答 默认 最新

相关推荐 更多相似问题