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 _logger; public List? Runs { get; set; } public List? HistorySummary { get; set; } public string? Message { get; set; } public IndexModel(ICollectionReadModelService collectionReadModelService, ILogger 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 = "데이터 수집 현황을 불러올 수 없습니다."; } } }