Move API-specific responses to API project

This commit is contained in:
jvyden 2022-05-14 23:42:30 -04:00
commit b48f3df4e2
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
4 changed files with 7 additions and 3 deletions

View file

@ -1,4 +1,5 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Servers.API.Responses;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
using LBPUnion.ProjectLighthouse.Types.Settings;

View file

@ -1,6 +1,6 @@
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Servers.API.Responses;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Api;
using Microsoft.AspNetCore.Mvc;
namespace LBPUnion.ProjectLighthouse.Servers.API.Controllers;

View file

@ -0,0 +1,29 @@
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Levels;
namespace LBPUnion.ProjectLighthouse.Servers.API.Responses;
public struct MinimalSlot
{
public int SlotId { get; set; }
public string Name { get; set; }
public string IconHash { get; set; }
public bool TeamPick { get; set; }
public GameVersion GameVersion { get; set; }
#if DEBUG
public long FirstUploaded { get; set; }
#endif
public static MinimalSlot FromSlot(Slot slot)
=> new()
{
SlotId = slot.SlotId,
Name = slot.Name,
IconHash = slot.IconHash,
TeamPick = slot.TeamPick,
GameVersion = slot.GameVersion,
#if DEBUG
FirstUploaded = slot.FirstUploaded,
#endif
};
}

View file

@ -0,0 +1,10 @@
namespace LBPUnion.ProjectLighthouse.Servers.API.Responses;
public class StatisticsResponse
{
public int RecentMatches { get; set; }
public int Slots { get; set; }
public int Users { get; set; }
public int TeamPicks { get; set; }
public int Photos { get; set; }
}