33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using ReserveManagementSystemApi.Services;
|
|
namespace ReserveManagementSystemApi.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("api/[controller]")]
|
|
public class StatusController : ControllerBase
|
|
{
|
|
private readonly IStatusService _statusService;
|
|
public StatusController(IStatusService statusService)
|
|
{
|
|
_statusService = statusService;
|
|
}
|
|
|
|
[HttpGet]
|
|
[ProducesResponseType(200)]
|
|
[ProducesResponseType(500)]
|
|
public IActionResult Get()
|
|
{
|
|
try
|
|
{
|
|
return Ok(_statusService.GetEnviromentView());
|
|
}
|
|
catch (ServiceException exception)
|
|
{
|
|
return StatusCode(StatusCodes.Status500InternalServerError, exception.Message);
|
|
}
|
|
catch (Exception exception)
|
|
{
|
|
Log.Error(exception, "Unexpected Exception");
|
|
return StatusCode(StatusCodes.Status500InternalServerError);
|
|
}
|
|
}
|
|
} |