using detect.gui.Models;
using detect.gui.Models.Entities;
using Newtonsoft.Json;

namespace detect.gui.Api.Helpers;

public class UserHelper
{
    public static ApiResponse<UserEntity>? Login(string? username, string? password)
    {
        var data = new { Username = username, Password = password };
        var param = JsonConvert.SerializeObject(data, new JsonSerializerSettings
        {
            NullValueHandling = NullValueHandling.Ignore
        });
        return ApiHelper.Post<UserEntity>("/v1/system/user/login", param, false);
    }
}