feat(ranking): stub /ranking/* (6 endpoints)
Rankings menu opens. Period picker shows deterministic monthly schedule.
Every leaderboard returns { period, ranking: [] }.
Endpoints:
- /ranking/get_viewable_ranking_period_list
- /ranking/master_point_{rotation,unlimited}_info
- /ranking/rank_match_class_win_{rotation,unlimited}_info
- /ranking/two_pick_win_info
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class ClassWinInfoRequestDto : BaseRequest
|
||||
{
|
||||
[JsonPropertyName("period_id"), Key("period_id")]
|
||||
public int PeriodId { get; set; }
|
||||
|
||||
[JsonPropertyName("class_id"), Key("class_id")]
|
||||
public int ClassId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class MasterPointInfoRequestDto : BaseRequest
|
||||
{
|
||||
[JsonPropertyName("period_id"), Key("period_id")]
|
||||
public int PeriodId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class MasterPointPeriodEntryDto : PeriodEntryDto
|
||||
{
|
||||
[JsonPropertyName("necessary_score"), Key("necessary_score")]
|
||||
public string NecessaryScore { get; set; } = "0";
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class MonthlyRankingResponseDto
|
||||
{
|
||||
[JsonPropertyName("period"), Key("period")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public PeriodEntryDto Period { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("ranking"), Key("ranking")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<RankingEntryDto> Ranking { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
/// <summary>
|
||||
/// Base period-entry shape used by /ranking/get_viewable_ranking_period_list's
|
||||
/// rank_match[] and crossover_* arrays. Master-point and two-pick variants
|
||||
/// add fields — see <see cref="MasterPointPeriodEntryDto"/> and
|
||||
/// <see cref="TwoPickPeriodEntryDto"/>.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class PeriodEntryDto
|
||||
{
|
||||
[JsonPropertyName("id"), Key("id")]
|
||||
public string Id { get; set; } = "0";
|
||||
|
||||
[JsonPropertyName("period_num"), Key("period_num")]
|
||||
public string PeriodNum { get; set; } = "0";
|
||||
|
||||
[JsonPropertyName("begin_time"), Key("begin_time")]
|
||||
public string BeginTime { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("end_time"), Key("end_time")]
|
||||
public string EndTime { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class PeriodListResponseDto
|
||||
{
|
||||
// All required per spec; emit empty list, never null.
|
||||
[JsonPropertyName("rank_match"), Key("rank_match")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<PeriodEntryDto> RankMatch { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("master_point"), Key("master_point")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<MasterPointPeriodEntryDto> MasterPoint { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("two_pick"), Key("two_pick")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<TwoPickPeriodEntryDto> TwoPick { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("sealed"), Key("sealed")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<PeriodEntryDto> Sealed { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("crossover_rank_match"), Key("crossover_rank_match")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<PeriodEntryDto> CrossoverRankMatch { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("crossover_master_point"), Key("crossover_master_point")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public List<PeriodEntryDto> CrossoverMasterPoint { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
/// <summary>
|
||||
/// One row in a /ranking/* leaderboard's `ranking[]` array. Stub server never
|
||||
/// emits these; the type exists so the DTO compiles and so wire-shape tests can
|
||||
/// parse captured prod frames into it. Wire-type quirks (per capture frame 65):
|
||||
/// viewer_id/score/ranking_rank are STRINGS; rank/emblem_id/degree_id are NUMBERS.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public sealed class RankingEntryDto
|
||||
{
|
||||
[JsonPropertyName("viewer_id"), Key("viewer_id")]
|
||||
public string ViewerId { get; set; } = "0";
|
||||
|
||||
[JsonPropertyName("score"), Key("score")]
|
||||
public string Score { get; set; } = "0";
|
||||
|
||||
[JsonPropertyName("ranking_rank"), Key("ranking_rank")]
|
||||
public string RankingRank { get; set; } = "0";
|
||||
|
||||
[JsonPropertyName("name"), Key("name")]
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("country_code"), Key("country_code")]
|
||||
public string CountryCode { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("rank"), Key("rank")]
|
||||
public int Rank { get; set; }
|
||||
|
||||
[JsonPropertyName("emblem_id"), Key("emblem_id")]
|
||||
public long EmblemId { get; set; }
|
||||
|
||||
[JsonPropertyName("degree_id"), Key("degree_id")]
|
||||
public long DegreeId { get; set; }
|
||||
|
||||
[JsonPropertyName("last_play_time"), Key("last_play_time")]
|
||||
public string LastPlayTime { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("guild_name"), Key("guild_name")]
|
||||
public string GuildName { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class TwoPickPeriodEntryDto : PeriodEntryDto
|
||||
{
|
||||
[JsonPropertyName("type"), Key("type")]
|
||||
public string Type { get; set; } = "2";
|
||||
|
||||
[JsonPropertyName("over_460"), Key("over_460")]
|
||||
public string Over460 { get; set; } = "1";
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using MessagePack;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Ranking;
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class TwoPickWinInfoRequestDto : BaseRequest
|
||||
{
|
||||
[JsonPropertyName("period_id"), Key("period_id")]
|
||||
public int PeriodId { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user