“mitao”
2026-04-12 43d605c9eb708326cf229942bc0117cb8accd1c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.xiaopeng.operation.controller;
 
import com.xiaopeng.api.model.operation.SysMenu;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.controller.BaseController;
import com.xiaopeng.operation.service.ISysMenuService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
 
/**
 * 菜单信息
 *
 * @author ruoyi
 */
@RestController
public class SysMenuController extends BaseController
{
    @Resource
    private ISysMenuService menuService;
 
    /**
     * 根据菜单ID列表获取菜单列表
     * 内部服务调用接口
     *
     * @param menuIds 菜单ID列表
     * @return 菜单列表
     */
    @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());
    }
 
}