using e_suite.API.Common; using e_suite.Utilities.Pagination; using eSuite.API.security; using eSuite.API.Utilities; using eSuite.Core.Security; using Microsoft.AspNetCore.Mvc; namespace eSuite.API.Controllers; /// /// This part of the API is responsible for maintaining Exception Logs within e-suite /// [Route("api/[controller]")] [ApiController] public class ExceptionLogsController : ESuiteControllerBase { private readonly IExceptionLogManager _exceptionLogManager; /// /// Default constructor used for dependency injection /// public ExceptionLogsController(IExceptionLogManager exceptionLogManager) { _exceptionLogManager = exceptionLogManager; } /// /// Returns a list of all the exception logs in the system /// /// This returns all the exception logs in the system. /// /// /// [Route("exceptionlogs")] [HttpGet] [AccessKey(SecurityAccess.ViewErrorLogs)] [ProducesResponseType(StatusCodes.Status200OK)] public async Task Get([FromQuery] Paging paging, CancellationToken cancellationToken = default!) { var result = await _exceptionLogManager.GetExceptionLogs(paging, cancellationToken); return Ok(result); } }