Files
monorepo/LCU.API.Internal.MemberPreferencesApi/LCU.API.Internal.MemberPreferencesApi/Controllers/QueueXdiBatchProcessController.cs
T
2026-05-04 10:09:55 -05:00

40 lines
1.2 KiB
C#

using LCU.API.Internal.MemberPreferencesApi.Services.QueueServices;
using Microsoft.AspNetCore.Mvc;
using Microsoft.FeatureManagement.Mvc;
namespace LCU.API.Internal.MemberPreferencesApi.Controllers;
[FeatureGate(FeatureGates.EnableControllers)]
[ApiController]
[Route("api/[controller]")]
public class QueueXdiBatchProcessController : ControllerBase
{
private readonly IQueueXdiBatchProcessService _queueXdiBatchProcessService;
public QueueXdiBatchProcessController(IQueueXdiBatchProcessService queueXdiBatchProcessService)
{
_queueXdiBatchProcessService = queueXdiBatchProcessService;
}
[HttpPost]
[ProducesResponseType(200)]
[ProducesResponseType(500)]
public async Task<IActionResult> QueueXdiBatchRequest(XdiBatchProcessRequest request)
{
try
{
await _queueXdiBatchProcessService.QueueXdiBatchProcess(request);
return Ok();
}
catch (ServiceException)
{
return StatusCode(StatusCodes.Status500InternalServerError);
}
catch (Exception exception)
{
Log.Error(exception, "Unexpected Exception");
return StatusCode(StatusCodes.Status500InternalServerError);
}
}
}