Migrate GetPlatformStatsFunction to IMetricsRepository

Completes non-Vulnerability function migrations. Remaining 14 files still
using TableStorageService are: 8 Vulnerability functions (use GetTableClient),
ReseedFromGitHub, ApiKeyManagement, BlockedDevice/VersionService,
SessionReportService, ApiKeyMiddleware — these need interface additions first.

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
This commit is contained in:
Claude
2026-03-27 06:42:39 +00:00
parent b3187d9ef3
commit 799ec0a39b
@@ -13,12 +13,12 @@ namespace AutopilotMonitor.Functions.Functions.Metrics
public class GetPlatformStatsFunction
{
private readonly ILogger<GetPlatformStatsFunction> _logger;
private readonly TableStorageService _storageService;
private readonly IMetricsRepository _metricsRepo;
public GetPlatformStatsFunction(ILogger<GetPlatformStatsFunction> logger, TableStorageService storageService)
public GetPlatformStatsFunction(ILogger<GetPlatformStatsFunction> logger, IMetricsRepository metricsRepo)
{
_logger = logger;
_storageService = storageService;
_metricsRepo = metricsRepo;
}
[Function("GetPlatformStats")]
@@ -27,7 +27,7 @@ namespace AutopilotMonitor.Functions.Functions.Metrics
{
try
{
var stats = await _storageService.GetPlatformStatsAsync();
var stats = await _metricsRepo.GetPlatformStatsAsync();
var response = req.CreateResponse(HttpStatusCode.OK);