| | |
| | | import com.zy.asrs.wcs.system.entity.Menu; |
| | | import com.zy.asrs.wcs.system.service.MenuService; |
| | | import com.zy.asrs.wcs.utils.ExcelUtil; |
| | | import com.zy.asrs.wcs.utils.Utils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:menu:list')") |
| | | @PostMapping("/menu/tree") |
| | | public R tree(@RequestBody Map<String, Object> map) { |
| | | List<Menu> menus = menuService.list(); |
| | | return R.ok().add(Utils.toTreeData(menus, 0L, Menu::getParentId, Menu::getId, Menu::setChildren)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:menu:list')") |
| | | @GetMapping("/menu/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(menuService.getById(id)); |