using Admin.Core.Common.Input; using Admin.Core.Common.Output; using Admin.Core.Model.Admin; using Admin.Core.Service.Admin.Role; using Admin.Core.Service.Admin.Role.Input; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; namespace Admin.Core.Controllers.Admin { /// /// 角色管理 /// public class RoleController : AreaController { private readonly IRoleService _roleService; public RoleController(IRoleService roleService) { _roleService = roleService; } /// /// 查询单条角色 /// /// /// [HttpGet] public async Task Get(long id) { return await _roleService.GetAsync(id); } /// /// 查询分页角色 /// /// /// [HttpPost] public async Task GetPage(PageInput model) { return await _roleService.PageAsync(model); } /// /// 新增角色 /// /// /// [HttpPost] public async Task Add(RoleAddInput input) { return await _roleService.AddAsync(input); } /// /// 修改角色 /// /// /// [HttpPut] public async Task Update(RoleUpdateInput input) { return await _roleService.UpdateAsync(input); } /// /// 删除角色 /// /// /// [HttpDelete] public async Task SoftDelete(long id) { return await _roleService.SoftDeleteAsync(id); } /// /// 批量删除角色 /// /// /// [HttpPut] public async Task BatchSoftDelete(long[] ids) { return await _roleService.BatchSoftDeleteAsync(ids); } } }