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 GenerateKeyAsync(Contract a_contract) { if (await m_keyService.GenerateKey(a_contract)) { return Ok("Key generated"); } else { return BadRequest(); } } } }