mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-08 11:32:28 +00:00
Move servers to LBPU.PL.Servers
This commit is contained in:
parent
545b5a0709
commit
b2ec7eae57
116 changed files with 173 additions and 162 deletions
|
@ -0,0 +1,31 @@
|
|||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using LBPUnion.ProjectLighthouse.Types.Api;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Servers.API.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// A collection of endpoints relating to statistics.
|
||||
/// </summary>
|
||||
public class StatisticsEndpoints : ApiEndpointController
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets everything that StatisticsHelper provides.
|
||||
/// </summary>
|
||||
/// <returns>An instance of StatisticsResponse</returns>
|
||||
[HttpGet("statistics")]
|
||||
[ProducesResponseType(typeof(StatisticsResponse), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> 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(),
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue