| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.xiaopeng.api.model.operation.SysMenu; |
| | | import com.xiaopeng.api.model.operation.SysMenuBak; |
| | | import com.xiaopeng.api.model.operation.SysMenus; |
| | | import com.xiaopeng.common.core.constant.UserConstants; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.domain.AjaxResult; |
| | | import com.xiaopeng.common.log.annotation.Log; |
| | | import com.xiaopeng.common.log.enums.BusinessType; |
| | | import com.xiaopeng.common.security.annotation.Logical; |
| | | import com.xiaopeng.common.security.annotation.RequiresPermissions; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.common.security.utils.SecurityUtils; |
| | | import com.xiaopeng.operation.service.ISysMenuBakService; |
| | | import com.xiaopeng.operation.service.ISysMenuService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/menu") |
| | | @Api(tags = "菜单模块") |
| | | public class SysMenuController extends BaseController |
| | | { |
| | | @Resource |
| | |
| | | * @param menuIds 菜单ID列表 |
| | | * @return 菜单列表 |
| | | */ |
| | | @PostMapping("/getMenusByMenuIds") |
| | | @ApiOperation(value = "根据菜单ID列表获取菜单列表", notes = "内部服务调用") |
| | | @PostMapping("/menu/getMenusByMenuIds") |
| | | @ApiOperation(value = "根据菜单ID列表获取菜单列表", tags = {"内部服务调用"}) |
| | | public R<List<SysMenu>> getMenusByMenuIds(@RequestBody List<Long> menuIds) { |
| | | if (menuIds == null || menuIds.isEmpty()) { |
| | | return R.ok(new ArrayList<>()); |
| | |
| | | List<SysMenu> menus = menuService.selectMenusByMenuIds(menuIds); |
| | | return R.ok(menus); |
| | | } |
| | | |
| | | /** |
| | | * 获取全部菜单树 |
| | | * @return |
| | | */ |
| | | @GetMapping("/api/v1/getMenuTree/{type}") |
| | | @ApiOperation(value = "获取全部菜单树", tags = {"管理后台-权限组设置"}) |
| | | public R<List<SysMenu>> getMenuTree(@ApiParam(name = "type", value = "1=管理端 2=运维app") @PathVariable Integer type) { |
| | | List<SysMenu> menus = menuService.getMenuTree(type); |
| | | return R.ok(menus); |
| | | } |
| | | |
| | | @GetMapping("/api/v1/getPermission") |
| | | @ApiOperation(value = "获取获取当前登录用户菜单列表", tags = {"管理后台-菜单管理"}) |
| | | public R<List<SysMenu>> getPermission(){ |
| | | return R.ok(menuService.getPermission()); |
| | | } |
| | | |
| | | @GetMapping("/maintenance-app/api/v1/getAppPermission") |
| | | @ApiOperation(value = "获取获取当前登录用户权限列表", tags = {"运维APP-个人中心"}) |
| | | public R<List<SysMenu>> getAppPermission(){ |
| | | return R.ok(menuService.getAppPermission()); |
| | | } |
| | | |
| | | } |