using BPA.SAAS.Manage.Application.System.Dtos;
using BPA.SAAS.Manage.Application.System.Interface;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.System
{
    [ApiDescriptionSettings("SYS", Tag = "菜单信息")]
    public class MenuServices: IDynamicApiController
    {
        IMenuService _menuService;
        public MenuServices(IMenuService menuService)
        {
            _menuService = menuService;
        }
        [HttpPost("/api/menu/getmenutreepage")]
        public async Task<List<MenuTreeDtoOutput>> GetMenuTreePage(MenuTreeSearchDtoInput input)
        {
            return await _menuService.GetMenuTreePage(input);
        }
        /// <summary>
        /// 添加菜单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("/api/menu/add")]
        public async Task<bool> Add(MenuDtoInput input)
        {
            return await _menuService.Add(input);
        }
        /// <summary>
        /// 编辑菜单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("/api/menu/update")]
        public async Task<bool> Update(MenuDtoInput input)
        {
            return await _menuService.Update(input);
        }
        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("/api/menu/delete")]
        public async Task<bool> Delete(List<string> input)
        {
            return await _menuService.Delete(input);
        }
        /// <summary>
        /// 查询菜单树
        /// </summary>
        /// <param name="getType"></param>
        /// <returns></returns>
        [HttpGet("/api/menu/menutrees")]
        public async Task<List<MenuTreeOutput>> MenuTree(string GetType)
        {
            return await _menuService.MenuTree(GetType);
        }
        [HttpGet("/api/menu/menutreesall")]
        public async Task<List<MenuTreeOutput>> MenuTree()
        {
            return await _menuService.MenuTree();
        }
        [HttpGet("/api/menu/menuparmytrees")]
        public async  Task<List<MenuTreeOutput>> MenuParmyTree(string GetType, string type)
        {
            return await _menuService.MenuParmyTree(GetType, type);
        }
        [HttpGet("/api/menu/menutree")]
        public async Task<List<MenuRouteDtoOutput>> DymicMenuTree(int type)
        {
            return await _menuService.DymicMenuTree(type);
        }
        [HttpGet("/api/menu/enable")]
        public async Task<bool> Enable(string Id)
        {
            return await _menuService.Enable(Id);
        }
        [HttpGet("/api/menu/disable")]
        public async Task<bool> Disable(string Id)
        {
            return await _menuService.Disable(Id);
        }
    }
}
