mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-06-26 17:01:28 +00:00
Revert slot API to old functionality
This commit is contained in:
parent
c6156d85cd
commit
f2dd41dd52
3 changed files with 81 additions and 10 deletions
42
ProjectLighthouse.Servers.API/Responses/MinimalApiSlot.cs
Normal file
42
ProjectLighthouse.Servers.API/Responses/MinimalApiSlot.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
||||
using LBPUnion.ProjectLighthouse.Types.Misc;
|
||||
using LBPUnion.ProjectLighthouse.Types.Users;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Servers.API.Responses;
|
||||
|
||||
[JsonObject]
|
||||
public struct MinimalApiSlot
|
||||
{
|
||||
public int SlotId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string IconHash { get; set; }
|
||||
public bool TeamPick { get; set; }
|
||||
public bool IsAdventure { get; set; }
|
||||
public Location Location { get; set; }
|
||||
public GameVersion GameVersion { get; set; }
|
||||
public long FirstUploaded { get; set; }
|
||||
public long LastUpdated { get; set; }
|
||||
public int Plays { get; set; }
|
||||
public int PlaysUnique { get; set; }
|
||||
public int PlaysComplete { get; set; }
|
||||
public bool CommentsEnabled { get; set; }
|
||||
|
||||
public static ApiSlot CreateFromEntity(SlotEntity slot) =>
|
||||
new()
|
||||
{
|
||||
SlotId = slot.SlotId,
|
||||
Name = slot.Name,
|
||||
IconHash = slot.IconHash,
|
||||
TeamPick = slot.TeamPick,
|
||||
IsAdventure = slot.IsAdventurePlanet,
|
||||
Location = slot.Location,
|
||||
GameVersion = slot.GameVersion,
|
||||
FirstUploaded = slot.FirstUploaded,
|
||||
LastUpdated = slot.LastUpdated,
|
||||
Plays = slot.Plays,
|
||||
PlaysUnique = slot.PlaysUnique,
|
||||
PlaysComplete = slot.PlaysComplete,
|
||||
CommentsEnabled = slot.CommentsEnabled,
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue