Userhez is lehet már NFC kódot rendelni
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using Android.Util;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Json;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.Helper
|
||||
{
|
||||
public static class SystemHelper
|
||||
{
|
||||
public static string DatabaseName = "";
|
||||
#if DEBUG
|
||||
public static string ApiBaseUrl = $"https://dev.wfcapi.nuvolar.hu/";
|
||||
public static string ApiKey = $"RUJeLSpSMzVASUdaRCEzUyYxRSE0VyFISFRSJC0zRzhLM1hCSDU=";
|
||||
|
||||
#endif
|
||||
#if !DEBUG
|
||||
public static string ApiBaseUrl = $"https://wfcapi.nuvolar.hu/";
|
||||
public static string ApiKey = $"RUJeLSpSMzVASUdaRCEzUyYxRSE0VyFISFRSJC0zRzhLM1hCSDU=";
|
||||
#endif
|
||||
public async static Task GetAPIInfoAsync()
|
||||
{
|
||||
using (var httpClient = new HttpClient())
|
||||
{
|
||||
|
||||
httpClient.BaseAddress = new Uri(ApiBaseUrl);
|
||||
httpClient.DefaultRequestHeaders.Add("X-Api-Key", ApiKey);
|
||||
|
||||
string endpoint = $"{ApiBaseUrl}api/System/GetDatabaseAndVersionInfo";
|
||||
var retVal = new RoleDTO();
|
||||
try
|
||||
{
|
||||
var response = await httpClient.GetFromJsonAsync<ApiResponseDTO<string>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
DatabaseName = response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Log.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user