34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using PSTW_CentralSystem.DBContext;
|
|
|
|
namespace PSTW_CentralSystem.Controllers.API
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class ModuleAPI : Controller
|
|
{
|
|
private readonly ILogger<HomeController> _logger;
|
|
private readonly AuthDBContext _authDbContext;
|
|
public ModuleAPI(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);
|
|
}
|
|
|
|
[HttpPost("GetXModuleInformation")]
|
|
public async Task<IActionResult> GetXModuleInformation(int? id)
|
|
{
|
|
var qcList = await _authDbContext.ModuleSettings.Where(x => x.SettingId == id).FirstOrDefaultAsync();
|
|
return Json(qcList);
|
|
}
|
|
}
|
|
}
|