package com.corewing.app.modules.admin.sys;

import com.corewing.app.common.Result;
import com.corewing.app.entity.SysMenu;
import com.corewing.app.service.SysMenuService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/sys/menu")
public class SysMenuController {

    @Resource
    private SysMenuService sysMenuService;

    @GetMapping("/initSysMenu")
    @ResponseBody
    public Result<List<SysMenu>> initSysMenu() {
        List<SysMenu> sysMenus = sysMenuService.initSysMenu();
        return Result.success(sysMenus);
    }

}
