36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System;
|
|
using LCU.Shared.Collections.RepoApiLib.Models;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Serilog;
|
|
|
|
namespace LCU.API.Collections.RepoApi.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class StatusController : RepoControllerBase
|
|
{
|
|
private readonly IEnvironmentView _environmentView;
|
|
|
|
public StatusController(IHttpContextAccessor httpContextAccessor, IEnvironmentView environmentView) : base(httpContextAccessor)
|
|
{
|
|
_environmentView = environmentView;
|
|
}
|
|
|
|
[HttpGet()]
|
|
[ProducesResponseType(200)]
|
|
[ProducesResponseType(500)]
|
|
public IActionResult Get()
|
|
{
|
|
try
|
|
{
|
|
return Ok(_environmentView);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}");
|
|
return StatusCode((int) System.Net.HttpStatusCode.InternalServerError);
|
|
}
|
|
}
|
|
}
|
|
} |