using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Yi.Framework.Common.Models; using Yi.Framework.Interface; using Yi.Framework.Model.Models; namespace Yi.Framework.ApiMicroservice.Controllers { [Route("api/[controller]")] [ApiController] public class RoleController : ControllerBase { private IRoleService _roleService; public RoleController(IRoleService roleService) { _roleService = roleService; } [HttpGet] public async Task GetURole() { return Result.Success().SetData(await _roleService.GetAllEntitiesTrueAsync()); } /// /// 更 /// /// /// [HttpPut] public async Task UpdateRole(role _role) { await _roleService.UpdateAsync(_role); return Result.Success(); } /// /// 删 /// /// /// [HttpDelete] public async Task DelListRole(List _ids) { await _roleService.DelListByUpdateAsync(_ids); return Result.Success(); } /// /// 增 /// /// /// [HttpPost] public async Task AddRole(role _role) { await _roleService.AddAsync(_role); return Result.Success(); } } }