mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-10 12:12:27 +00:00
Move api controller endpoints to api project
This commit is contained in:
parent
47271d1798
commit
4caef5fd63
5 changed files with 5 additions and 13 deletions
31
ProjectLighthouse.API/Controllers/StatisticsEndpoints.cs
Normal file
31
ProjectLighthouse.API/Controllers/StatisticsEndpoints.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using LBPUnion.ProjectLighthouse.Types.Api;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.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