Update to dotnet 9.0, add user roles, MatchStats and OpenApi/Scalar in dev
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LaDOSE.DTO
|
||||
{
|
||||
@@ -9,8 +10,13 @@ namespace LaDOSE.DTO
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Username { get; set; }
|
||||
|
||||
/// <summary>Only ever read from a request; never populated on a response.</summary>
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>Role names held by the user, e.g. <c>["Admin"]</c>. Empty means a plain user.</summary>
|
||||
public List<string> Roles { get; set; }
|
||||
|
||||
public string Token { get; set; }
|
||||
public DateTime Expire { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
namespace LaDOSE.DTO
|
||||
using System;
|
||||
|
||||
namespace LaDOSE.DTO
|
||||
{
|
||||
public class EventDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>Event date, mapped by convention from Event.Date. Used for time-series charts.</summary>
|
||||
public DateTime Date { get; set; }
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LaDOSE.DTO
|
||||
{
|
||||
public class MatchStatsDTO
|
||||
{
|
||||
public MatchCoverageDTO Coverage { get; set; }
|
||||
public List<PlayerMatchStatsDTO> Players { get; set; }
|
||||
public List<HeadToHeadDTO> HeadToHead { get; set; }
|
||||
}
|
||||
|
||||
public class MatchCoverageDTO
|
||||
{
|
||||
/// <summary>Requested event ids that actually exist.</summary>
|
||||
public int Events { get; set; }
|
||||
|
||||
/// <summary>Tournaments (brackets) belonging to those events.</summary>
|
||||
public int Brackets { get; set; }
|
||||
|
||||
/// <summary>Of those brackets, how many have at least one set row.</summary>
|
||||
public int BracketsWithSets { get; set; }
|
||||
|
||||
/// <summary>Total set rows in scope, including unusable ones.</summary>
|
||||
public int Sets { get; set; }
|
||||
|
||||
/// <summary>Sets with a determinable winner.</summary>
|
||||
public int DecidedSets { get; set; }
|
||||
}
|
||||
|
||||
public class PlayerMatchStatsDTO
|
||||
{
|
||||
public int PlayerId { get; set; }
|
||||
|
||||
/// <summary>Gamertag, falling back to Name, else "#<id>".</summary>
|
||||
public string Player { get; set; }
|
||||
|
||||
/// <summary>Decided sets only. Always equals Wins + Losses.</summary>
|
||||
public int Sets { get; set; }
|
||||
|
||||
public int Wins { get; set; }
|
||||
public int Losses { get; set; }
|
||||
public int GamesWon { get; set; }
|
||||
public int GamesLost { get; set; }
|
||||
}
|
||||
|
||||
public class HeadToHeadDTO
|
||||
{
|
||||
public int PlayerAId { get; set; }
|
||||
public string PlayerA { get; set; }
|
||||
public int PlayerBId { get; set; }
|
||||
public string PlayerB { get; set; }
|
||||
public int WinsA { get; set; }
|
||||
public int WinsB { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user