using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using LanMontainDesktop.Models; namespace LanMontainDesktop.Services; public sealed record WeatherQuery( string LocationKey, double Latitude, double Longitude, int ForecastDays = 7, string? Locale = null, bool? IsGlobal = null, bool ForceRefresh = false); public sealed record WeatherQueryResult( bool Success, T? Data, string? ErrorCode = null, string? ErrorMessage = null) { public static WeatherQueryResult Ok(T data) { return new WeatherQueryResult(true, data); } public static WeatherQueryResult Fail(string errorCode, string errorMessage) { return new WeatherQueryResult(false, default, errorCode, errorMessage); } } public interface IWeatherDataService { Task> GetWeatherAsync(WeatherQuery query, CancellationToken cancellationToken = default); Task>> SearchLocationsAsync( string keyword, string? locale = null, CancellationToken cancellationToken = default); void ClearCache(); }