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 } }