This commit is contained in:
Zeeshaun
2026-03-24 15:28:37 -05:00
parent 9cc87337b8
commit 73d62efb39
58 changed files with 2952 additions and 0 deletions
@@ -0,0 +1,49 @@
using System;
using Serilog;
using System.Collections.Generic;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using LCU.Api.Internal.FTP.Extensions;
using LCU.Api.Internal.FTP.Services;
using LCU.Api.Internal.FTPLib.Models;
using LCU.Library.Internal.Exceptions;
namespace LCU.Api.Internal.FTP.Controllers;
[Route("[controller]")]
[ApiController]
public class SshFtpController : ControllerBase
{
private readonly IQueueSshFtpService _queueSshFtpService;
public SshFtpController(IQueueSshFtpService queueSshFtpService)
{
_queueSshFtpService = queueSshFtpService;
}
[HttpPost("QueueSshFtpRequest")]
[ProducesResponseType(201)]
[ProducesResponseType(typeof(List<string>), 400)]
[ProducesResponseType(500)]
public IActionResult QueueSshFtpRequest([FromBody] SshFtpRequest request)
{
try
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorMessages());
}
_queueSshFtpService.QueueSshFtpRequest(request);
return Ok();
}
catch (ServiceException)
{
return StatusCode(StatusCodes.Status500InternalServerError);
}
catch (Exception exception)
{
Log.Error(exception, "Unexpected Exception");
return StatusCode(StatusCodes.Status500InternalServerError);
}
}
}