You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
891 B
32 lines
891 B
using Cloud_Manager.Models.ClientContractModels;
|
|
using Cloud_Manager.Models.CustomModels;
|
|
using Cloud_Manager.Models.Interfaces;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Cloud_Manager.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class KeyGeneratorController : ControllerBase
|
|
{
|
|
private readonly IKeyService m_keyService;
|
|
public KeyGeneratorController(IKeyService a_keyService)
|
|
{
|
|
m_keyService = a_keyService;
|
|
}
|
|
|
|
[HttpPost, Route("generate-key")]
|
|
public async Task<IActionResult> GenerateKeyAsync(Contract a_contract)
|
|
{
|
|
if (await m_keyService.GenerateKey(a_contract))
|
|
{
|
|
return Ok("Key generated");
|
|
}
|
|
else
|
|
{
|
|
return BadRequest();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|