PSTW_CentralizeSystem/Controllers/API/AdminAPI.cs
2024-11-20 16:27:35 +08:00

33 lines
887 B
C#

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using PSTW_CentralSystem.DBContext;
using PSTW_CentralSystem.Models;
using System.Diagnostics;
namespace PSTW_CentralSystem.Controllers.API
{
[ApiController]
[Route("[controller]")]
public class AdminAPI : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly AuthDBContext _authDbContext;
public AdminAPI(ILogger<HomeController> logger, AuthDBContext authDbContext)
{
_logger = logger;
_authDbContext = authDbContext;
}
[HttpPost("GetModuleInformation")]
public async Task<IActionResult> GetModuleInformation()
{
var qcList = await _authDbContext.ModuleSettings.ToListAsync();
return Json(qcList);
}
}
}