1
0
mirror of synced 2024-12-19 01:46:09 +01:00
TaikoLocalServer/TaikoWebUI/Components/Song/SongLeaderboardCard.razor.cs

28 lines
724 B
C#
Raw Normal View History

2024-06-03 01:55:44 +02:00

namespace TaikoWebUI.Components.Song;
public partial class SongLeaderboardCard
{
private SongLeaderboardResponse? response;
[Parameter]
public int SongId { get; set; }
[Parameter]
public int Baid { get; set; }
[Parameter]
public Difficulty Difficulty { get; set; } = Difficulty.Easy;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
response = await Client.GetFromJsonAsync<SongLeaderboardResponse>($"api/SongLeaderboardData/{(uint)Baid}/{(uint)SongId}/{(uint)Difficulty}");
response.ThrowIfNull();
// log the leaderboard
Console.WriteLine(response.Leaderboard);
}
}