29 lines
689 B
C#
29 lines
689 B
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using Gamenight.Ui.Services;
|
|
|
|
namespace Gamenight.Ui.ViewModels;
|
|
|
|
public partial class MainViewModel : ViewModelBase
|
|
{
|
|
[ObservableProperty]
|
|
private string _greeting = "Welcome to Avalonia!";
|
|
|
|
private IGamenightApi GamenightApi { get; }
|
|
|
|
public MainViewModel(IGamenightApi gamenightApi)
|
|
{
|
|
GamenightApi = gamenightApi;
|
|
|
|
Test();
|
|
}
|
|
|
|
public async void Test() {
|
|
var token = await GamenightApi.TokenGet(new Login() {
|
|
Username = "Admin",
|
|
Password = "Gamenight!"
|
|
});
|
|
|
|
System.Console.WriteLine($"Token: {token.JwtToken}");
|
|
}
|
|
}
|