35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using ReserveManagementSystemApi.Services;
|
|
using ReserveManagementSystemLib.Models;
|
|
|
|
namespace ReserveManagementSystemApi.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class AuditHistoryController : ControllerBase
|
|
{
|
|
private readonly IAuditHistoryService _auditHistoryService;
|
|
|
|
public AuditHistoryController(IAuditHistoryService auditHistoryService)
|
|
{
|
|
_auditHistoryService = auditHistoryService;
|
|
}
|
|
|
|
[HttpGet(Name = "GetAllHistory")]
|
|
[ProducesResponseType(typeof(IEnumerable<AuditHistory>), 200)]
|
|
[ProducesResponseType(500)]
|
|
public async Task<IActionResult> Get()
|
|
{
|
|
try
|
|
{
|
|
var result = await _auditHistoryService.GetAllAsync();
|
|
return Ok(result);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.Error(e, "Failure returning Audit Histories");
|
|
return StatusCode(StatusCodes.Status500InternalServerError);
|
|
}
|
|
}
|
|
}
|
|
}
|