| | |
| | | package com.thhy.usercore.modules.sys.sysmenu.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.JSONToken; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.thhy.general.utils.PagingUtils; |
| | | import com.thhy.general.common.BasicResult; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.Serializable; |
| | | import java.io.*; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return BasicResult.success(sysMenusList); |
| | | } |
| | | |
| | | @RequestMapping("syncMenu") |
| | | public BasicResult syncMenu(){ |
| | | String value = ""; |
| | | try { |
| | | InputStream ins = new FileInputStream(new File("D:\\dd.txt")); |
| | | byte[] bytes = new byte[ins.available()]; |
| | | ins.read(bytes); |
| | | value = new String(bytes,"UTF-8"); |
| | | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | List<MenuTreeVo> sysMenusList = JSONArray.parseArray(value,MenuTreeVo.class); |
| | | sysMenusService.syncMenu(sysMenusList); |
| | | return BasicResult.success(sysMenusList); |
| | | } |
| | | |
| | | @RequestMapping("allRoleMenu") |
| | | public BasicResult allRoleMenu(@RequestBody MenuDto menuDto){ |
| | | menuDto.setParentId("0"); |