/*
 * Copyright (c) 2019, PANNK and/or its affiliates. All rights reserved.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */
package com.pannk.mms.modules.sys.controller;

import com.pannk.mms.common.base.BaseController;
import com.pannk.mms.common.base.Result;
import com.pannk.mms.modules.sys.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author：wolf
 * @date：2020/11/2 23:38
 **/
@RequestMapping("/sys/menu")
@RestController
public class SysMenuController extends BaseController {

    @Autowired
    private SysMenuService sysMenuService;

    /**
     * 用户菜单列表和权限
     *
     * @return
     */
    @GetMapping("/nav")
    public Result nav() {
        return Result.success(sysMenuService.getUserMenuList(getUserId()));
    }

    @GetMapping("/list")
    public Result list() {
        return Result.success(sysMenuService.list());
    }
}
