Files
QuantEngineByItz/src/dotnet/QuantEngine.Web/Pages/Admin/Collection/Index.cshtml.cs
T
kjh2064 bccefed35e
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 16s
Validators (Pushes and Pull Requests) / validate-core (push) Successful in 2m3s
refactor(dotnet): separate collection read model service
2026-07-13 00:44:43 +09:00

39 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.RazorPages;
using QuantEngine.Application.Interfaces;
using QuantEngine.Core.Interfaces;
using QuantEngine.Web.Services;
namespace QuantEngine.Web.Pages.Admin.Collection;
[Authorize(AuthenticationSchemes = AdminAuthDefaults.Scheme)]
public class IndexModel : PageModel
{
private readonly ICollectionReadModelService _collectionReadModelService;
private readonly ILogger<IndexModel> _logger;
public List<CollectionRunRecord>? Runs { get; set; }
public List<PriceHistorySummaryRecord>? HistorySummary { get; set; }
public string? Message { get; set; }
public IndexModel(ICollectionReadModelService collectionReadModelService, ILogger<IndexModel> logger)
{
_collectionReadModelService = collectionReadModelService;
_logger = logger;
}
public async Task OnGetAsync()
{
try
{
Runs = await _collectionReadModelService.GetRecentRunsAsync(limit: 20);
HistorySummary = await _collectionReadModelService.GetPriceHistorySummaryAsync();
}
catch (Exception ex)
{
_logger.LogError(ex, "Collection data loading failed");
Message = "데이터 수집 현황을 불러올 수 없습니다.";
}
}
}