Business és Audit log hozzáadva, WEB-en letölthető

This commit is contained in:
2025-04-28 11:35:30 +02:00
parent 2fae17fed4
commit 9ffbcd87f2
9 changed files with 441 additions and 8 deletions
@@ -6,7 +6,15 @@ namespace WorkFlowCheck.Web.Services.Interfaces
{
Task<List<ImageFileDTO>> GetAllImageFilesAsync();
Task<ApiResponseDTO<byte[]>> DownloadFile(string filename);
Task<List<PDFFileDTO>> GetAllPDFFilesAsync();
Task<ApiResponseDTO<byte[]>> DownloadPDFFile(string filename);
Task<List<LogFileDTO>> GetAllLogAuditFilesAsync();
Task<ApiResponseDTO<byte[]>> DownloadAuditLogFile(string filename);
Task<List<LogFileDTO>> GetAllLogBusinessFilesAsync();
Task<ApiResponseDTO<byte[]>> DownloadBusinessLogFile(string filename);
}
}
@@ -93,5 +93,91 @@ namespace WorkFlowCheck.Web.Services
}
return retVal;
}
public async Task<List<LogFileDTO>> GetAllLogAuditFilesAsync()
{
var endpoint = $"{_httpClient.BaseAddress}api/System/GetAllLogAuditFiles";
var retVal = new List<LogFileDTO>();
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<List<LogFileDTO>>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<ApiResponseDTO<byte[]>> DownloadAuditLogFile(string filename)
{
var retVal = new ApiResponseDTO<byte[]>();
var endpoint = $"{_httpClient.BaseAddress}api/System/DownloadAuditLogFile/{filename}";
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<byte[]>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<LogFileDTO>> GetAllLogBusinessFilesAsync()
{
var endpoint = $"{_httpClient.BaseAddress}api/System/GetAllLogBusinessFiles";
var retVal = new List<LogFileDTO>();
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<List<LogFileDTO>>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<ApiResponseDTO<byte[]>> DownloadBusinessLogFile(string filename)
{
var retVal = new ApiResponseDTO<byte[]>();
var endpoint = $"{_httpClient.BaseAddress}api/System/DownloadBusinessLogFile/{filename}";
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<byte[]>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
}
}