using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Api;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.API.Controllers;
///
/// A collection of endpoints relating to statistics.
///
public class StatisticsEndpoints : ApiEndpointController
{
///
/// Gets everything that StatisticsHelper provides.
///
/// An instance of StatisticsResponse
[HttpGet("statistics")]
[ProducesResponseType(typeof(StatisticsResponse), StatusCodes.Status200OK)]
public async Task GetStatistics()
=> this.Ok
(
new StatisticsResponse
{
Photos = await StatisticsHelper.PhotoCount(),
Slots = await StatisticsHelper.SlotCount(),
Users = await StatisticsHelper.UserCount(),
RecentMatches = await StatisticsHelper.RecentMatches(),
TeamPicks = await StatisticsHelper.TeamPickCount(),
}
);
}