qq_28285633 2018-09-17 08:25 采纳率: 100%
浏览 1236
已采纳

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条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 Python函数嵌套调用与递归
      • ¥20 不会做,找个好心人帮做,有偿,只要答案,不要说废话
      • ¥15 html页面铺满及插入音乐
      • ¥15 T5模型代码问题求助
      • ¥15 JSON文件存入数据库mysql/MongoDB
      • ¥15 C++实现更大的整数类
      • ¥15 Python怎么实现加减乘除乘方和阶乘呀
      • ¥15 centos8-arm64平台编译安装ray分布式计算框架。
      • ¥20 求帮做一个安卓app,用Android Studio制作。需要整个项目文件。
      • ¥15 使用深度学习对于楼梯尺寸进行检测