INIT GITEA

This commit is contained in:
2026-09-12 18:19:29 +02:00
parent b2faeb2986
commit 02ba8d4fe5
405 changed files with 125279 additions and 125267 deletions
+44 -44
View File
@@ -1,44 +1,44 @@
using Serilog;
using System.Net.Http;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.Web.Helpers
{
public static class SystemHelper
{
public static string DatabaseName = "";
public static string ProgramVersion = "v1.1.032";
public async static Task GetAPIInfoAsync(IConfiguration configuration)
{
using (var httpClient = new HttpClient())
{
var apiBaseUrl = configuration["ApiBaseUrl"]; // API-cím elérése a konfigurációból
httpClient.BaseAddress = new Uri(apiBaseUrl);
var apiKey = configuration["ApiKey"];
httpClient.DefaultRequestHeaders.Add("X-Api-Key", apiKey);
string endpoint = $"{httpClient.BaseAddress}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);
}
}
}
}
}
using Serilog;
using System.Net.Http;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.Web.Helpers
{
public static class SystemHelper
{
public static string DatabaseName = "";
public static string ProgramVersion = "v1.1.032";
public async static Task GetAPIInfoAsync(IConfiguration configuration)
{
using (var httpClient = new HttpClient())
{
var apiBaseUrl = configuration["ApiBaseUrl"]; // API-cím elérése a konfigurációból
httpClient.BaseAddress = new Uri(apiBaseUrl);
var apiKey = configuration["ApiKey"];
httpClient.DefaultRequestHeaders.Add("X-Api-Key", apiKey);
string endpoint = $"{httpClient.BaseAddress}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);
}
}
}
}
}