Java代码获取菜单列表的树形结构

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u011712163/article/details/78405630
 public  List<Map<String, Object>> menulist(String rolecode){
            //获取一级菜单通过角色
            List<Map<String, Object>> first = imManager.firstMod(rolecode);

            for(Map map1 : first){
                String moduleone = (String) map1.get("moduleone");
                //获取二级菜单
                List<Map<String, Object>> second = imManService.secondLevelMenu(rolecode, moduleone);;

                for(Map map2 : second){
                    String moduletwo = (String) map2.get("moduletwo");
                    //获取三级菜单
                    List<Map<String, Object>> third = imManService.thirdLevelMenu(rolecode, moduletwo);
                    map2.put("third", third);
                }
                map1.put("second", second);
            }
            return first;
    }


展开阅读全文

没有更多推荐了,返回首页