using Entity.DbModel.System.SysBaseObject; using Entity.DbModel; using HybirdFrameworkCore.Entity; using Microsoft.AspNetCore.Mvc; using Service.System; using Entity.Dto.Req; using Entity.Dto.Resp; namespace WebStarter.Controllers.System { [Produces("application/json")] [ApiController] public class SysMenuController { private SysMenuService _sysMenuServices; public SysMenuController(ILogger logger, SysMenuService sysMenuServices) { _sysMenuServices = sysMenuServices; } /// /// 获取登录菜单树 /// /// [HttpGet] [Route("/api/sysMenu/loginMenuTree")] public async Task> GetLoginMenuTree() { return await _sysMenuServices.GetLoginMenuTree(); } /// /// 获取菜单列表 /// /// /// [HttpGet] [Route("api/sysMenu/list")] public async Task> GetList([FromQuery] MenuReq input) { return await _sysMenuServices.GetList(input); } //[HttpGet] //[Route("api/sysMenu/ownBtnPermList")] //public async Task> GetOwnBtnPermList() //{ // return await _sysMenuServices.GetOwnBtnPermList(); //} /// /// 增加菜单 /// /// /// [HttpPost] [Route("/api/sysMenu/add")] public async Task> AddMenu([FromBody] AddMenuReq input) { int result = 0; var data = await _sysMenuServices.AddMenu(input); if (data == "增加菜单成功") { result = 200; return Result.Success(result); } else { return Result.Fail(result); } } /// /// 更新菜单 /// /// /// [HttpPost] [Route("/api/sysMenu/update")] public async Task> UpdateMenu([FromBody] UpdateMenuReq input) { var data = await _sysMenuServices.UpdateMenu(input); if (data == 200) return Result.Success(data); else { return Result.Fail(data); } } /// /// 删除菜单 /// /// /// [HttpPost] [Route("/api/sysMenu/delete")] public async Task DeleteMenu([FromBody] DeleteMenuReq input) { await _sysMenuServices.DeleteMenu(input); } } }