using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; using ZhonTai.Common.Domain.Dto; using ZhonTai.Plate.Admin.Domain.Role.Dto; using ZhonTai.Plate.Admin.Service.Role; using ZhonTai.Plate.Admin.Service.Role.Dto; namespace ZhonTai.Plate.Admin.HttpApi { /// /// 角色管理 /// 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 input) { return await _roleService.GetPageAsync(input); } /// /// 新增角色 /// /// /// [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); } } }