Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Net.Http.Json;
|
||||
using JdeScoping.Client.Models;
|
||||
|
||||
namespace JdeScoping.Client.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Handles refresh status API calls.
|
||||
/// Authentication is handled via cookies (sent automatically by the browser).
|
||||
/// </summary>
|
||||
public class RefreshStatusService : IRefreshStatusService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
|
||||
public RefreshStatusService(HttpClient httpClient)
|
||||
{
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public async Task<List<DataUpdateViewModel>> GetRefreshStatusAsync(DateTime minDt, DateTime maxDt)
|
||||
{
|
||||
try
|
||||
{
|
||||
var minDtStr = minDt.ToString("yyyy-MM-dd");
|
||||
var maxDtStr = maxDt.ToString("yyyy-MM-dd");
|
||||
var result = await _httpClient.GetFromJsonAsync<List<DataUpdateViewModel>>(
|
||||
$"api/refresh-status?minDT={minDtStr}&maxDT={maxDtStr}");
|
||||
return result ?? [];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Failed to get refresh status: {ex.Message}");
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user