Files
jinko.yikatong/Src/Dlhis.User/Identity/Controllers/RolesController.cs

36 lines
876 B
C#

using Dlhis.User.Identity.Request;
using Dlhis.User.Identity.Response;
using Dlhis.User.Identity.Services;
using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.User.Identity.Controllers;
/// <summary>
/// 角色
/// </summary>
[Authorize(Roles = "admin")]
[Route("api/[controller]")]
[ApiController]
public class RolesController : ControllerBase
{
private readonly IRoleService _roleService;
public RolesController(IRoleService roleService)
{
_roleService = roleService;
}
/// <summary>
/// 获取角色分页
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpGet]
public async Task<Pagination<RoleRespone>> GetPageAsync(RolePageRequest request)
{
return await _roleService.GetPageAsync(request);
}
}