Re-organised statistic endpoints and services/helpers

This commit is contained in:
2024-12-13 20:35:22 +01:00
parent d15c5326ed
commit edc91229e1
13 changed files with 218 additions and 191 deletions

View File

@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Mvc;
using MoonlightServers.Daemon.Helpers;
using MoonlightServers.DaemonShared.Http.Responses.Statistics;
namespace MoonlightServers.Daemon.Http.Controllers.Statistics;
// This controller hosts endpoints for the statistics for host system the daemon runs on
[ApiController]
[Route("api/statistics/host")]
public class StatisticsHostController : Controller
{
private readonly HostSystemHelper HostSystemHelper;
public StatisticsHostController(HostSystemHelper hostSystemHelper)
{
HostSystemHelper = hostSystemHelper;
}
[HttpGet]
public async Task<StatisticsHostResponse> Get()
{
return new()
{
OperatingSystem = HostSystemHelper.GetOsName()
};
}
}