Files
Geradores/GeradoresWS/Controllers/GenerateController.cs
Marco Santos 11e532ac9a New Layout
2025-07-13 21:43:37 +01:00

56 lines
1.2 KiB
C#

using Microsoft.AspNetCore.Mvc;
using GeradoresService;
using GeradoresService.DAL;
namespace GeradoresWS.Controllers
{
[ApiController]
[Route("[controller]")]
public class GenerateController : Controller
{
GeradoresContext _context;
public GenerateController(GeradoresContext context)
{
_context = context;
}
#region NIF
[HttpGet("GenerateNIF")]
public string GenerateNIF(NIF.NIFType type)
{
var nif = new NIF(_context);
return nif.Generate(type);
}
[HttpGet("ValidateNIF")]
public bool ValidateNIF(string nif)
{
var teste = new NIF(_context);
return teste.Validate(nif);
}
#endregion
#region NISS
[HttpGet("GenerateNISS")]
public string GenerateNISS()
{
return NISS.Generate();
}
[HttpGet("ValidateNISS")]
public bool ValidateNISS(string nif)
{
return NISS.Validate(nif);
}
#endregion
#region CC
[HttpGet("GenerateCC")]
public string GenerateCC()
{
return CartaoCidadao.Generate();
}
#endregion
}
}