Migrate Geographic Location Sessions functions to DAL

https://claude.ai/code/session_01NHWJfPaa8TQHuPzMD7gG63
This commit is contained in:
Claude
2026-03-27 06:37:41 +00:00
parent cae99b445f
commit ff6e43cecc
2 changed files with 10 additions and 10 deletions
@@ -1,6 +1,6 @@
using System.Net;
using AutopilotMonitor.Functions.Helpers;
using AutopilotMonitor.Functions.Services;
using AutopilotMonitor.Shared.DataAccess;
using AutopilotMonitor.Shared.Models;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
@@ -11,12 +11,12 @@ namespace AutopilotMonitor.Functions.Functions.Metrics
public class GetGeographicLocationSessionsFunction
{
private readonly ILogger<GetGeographicLocationSessionsFunction> _logger;
private readonly TableStorageService _storageService;
private readonly IMaintenanceRepository _maintenanceRepo;
public GetGeographicLocationSessionsFunction(ILogger<GetGeographicLocationSessionsFunction> logger, TableStorageService storageService)
public GetGeographicLocationSessionsFunction(ILogger<GetGeographicLocationSessionsFunction> logger, IMaintenanceRepository maintenanceRepo)
{
_logger = logger;
_storageService = storageService;
_maintenanceRepo = maintenanceRepo;
}
[Function("GetGeographicLocationSessions")]
@@ -48,7 +48,7 @@ namespace AutopilotMonitor.Functions.Functions.Metrics
locationKey, tenantId, days, groupBy);
var cutoff = DateTime.UtcNow.AddDays(-days);
var sessions = await _storageService.GetSessionsByDateRangeAsync(cutoff, DateTime.UtcNow.AddDays(1), tenantId);
var sessions = await _maintenanceRepo.GetSessionsByDateRangeAsync(cutoff, DateTime.UtcNow.AddDays(1), tenantId);
var filtered = FilterSessionsByLocation(sessions, locationKey, groupBy);
@@ -1,6 +1,6 @@
using System.Net;
using AutopilotMonitor.Functions.Helpers;
using AutopilotMonitor.Functions.Services;
using AutopilotMonitor.Shared.DataAccess;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Logging;
@@ -10,14 +10,14 @@ namespace AutopilotMonitor.Functions.Functions.Metrics
public class GetGlobalGeographicLocationSessionsFunction
{
private readonly ILogger<GetGlobalGeographicLocationSessionsFunction> _logger;
private readonly TableStorageService _storageService;
private readonly IMaintenanceRepository _maintenanceRepo;
public GetGlobalGeographicLocationSessionsFunction(
ILogger<GetGlobalGeographicLocationSessionsFunction> logger,
TableStorageService storageService)
IMaintenanceRepository maintenanceRepo)
{
_logger = logger;
_storageService = storageService;
_maintenanceRepo = maintenanceRepo;
}
[Function("GetGlobalGeographicLocationSessions")]
@@ -49,7 +49,7 @@ namespace AutopilotMonitor.Functions.Functions.Metrics
locationKey, days, groupBy, userEmail);
var cutoff = DateTime.UtcNow.AddDays(-days);
var sessions = await _storageService.GetSessionsByDateRangeAsync(cutoff, DateTime.UtcNow.AddDays(1));
var sessions = await _maintenanceRepo.GetSessionsByDateRangeAsync(cutoff, DateTime.UtcNow.AddDays(1));
var filtered = GetGeographicLocationSessionsFunction.FilterSessionsByLocation(sessions, locationKey, groupBy);