Adding MaidBotApi

This commit is contained in:
Zeeshaun
2026-03-11 13:21:47 -05:00
parent f3cb730f3b
commit f004c8205a
122 changed files with 4227 additions and 0 deletions
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Serilog;
using LCU.Api.Internal.MaidBotApi.Services;
using LCU.Api.Internal.MaidBotLib.Models;
using LCU.Library.Internal.Exceptions;
namespace LCU.API.Internal.MaidBotApi.Controllers;
[ApiController]
[Route("api/[controller]")]
public class QueueEventLogController : ControllerBase
{
private readonly IQueueEventLogService _queueEventLogService;
public QueueEventLogController(IQueueEventLogService queueEventLogService)
{
_queueEventLogService = queueEventLogService;
}
[HttpPost]
[ProducesResponseType(202)]
[ProducesResponseType(typeof(List<string>), 400)]
[ProducesResponseType(500)]
public async Task<IActionResult> Post([FromBody] EventLog EventLog)
{
try
{
await _queueEventLogService.QueueEventLog(EventLog);
return Accepted();
}
catch (ServiceException exception)
{
return StatusCode(StatusCodes.Status500InternalServerError, exception.Message);
}
catch (Exception exception)
{
Log.Error(exception, "Unexpected Exception");
return StatusCode(StatusCodes.Status500InternalServerError);
}
}
}