using YBEE.EQM.Core;

namespace YBEE.EQM.Application
{
    /// <summary>
    /// 角色
    /// </summary>
    [ApiDescriptionSettings(Name = "sys-role")]
    [Route("sys/role")]
    [AppAuthorize]
    public class SysRoleAppService : IDynamicApiController
    {
        private readonly ISysRoleService _roleService;
        public SysRoleAppService(ISysRoleService roleService)
        {
            _roleService = roleService;
        }

        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task Add(AddSysRoleInput input)
        {
            await _roleService.Add(input);
        }
        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [UnitOfWork]
        public async Task Del(DeleteSysRoleInput input)
        {
            await _roleService.Del(input);
        }
        /// <summary>
        /// 更新角色
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task Update(UpdateSysRoleInput input)
        {
            await _roleService.Update(input);
        }
        /// <summary>
        /// 获取所有角色
        /// </summary>
        /// <returns></returns>
        [DisableOpLog]
        public async Task<List<SysRoleOutput>> GetAllList()
        {
            return await _roleService.GetAllList();
        }
    }
}