29 lines
799 B
C#
29 lines
799 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using PSTW_CentralSystem.DBContext;
|
|
|
|
namespace PSTW_CentralSystem.Controllers.API
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class RoleAPI : Controller
|
|
{
|
|
|
|
private readonly ILogger<HomeController> _logger;
|
|
private readonly AuthDBContext _authDbContext;
|
|
|
|
public RoleAPI(ILogger<HomeController> logger, AuthDBContext authDbContext)
|
|
{
|
|
_logger = logger;
|
|
_authDbContext = authDbContext;
|
|
}
|
|
|
|
[HttpPost("GetRoleList")]
|
|
public async Task<IActionResult> GetRoleList()
|
|
{
|
|
var roleList = await _authDbContext.Roles.Where(r => r.Id != 1 && r.Id != 2).ToListAsync();
|
|
return Json(roleList);
|
|
}
|
|
}
|
|
}
|