mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-24 07:41:47 +00:00
22 lines
935 B
TypeScript
22 lines
935 B
TypeScript
import { getWeather, getDetailedWeather } from '../../services/weatherService';
|
|
import { Injectable } from '@nestjs/common';
|
|
import type { WeatherResult } from '@trek/shared';
|
|
|
|
/**
|
|
* Thin Nest wrapper around the existing weather service. It delegates to the
|
|
* exact same `getWeather` / `getDetailedWeather` functions the legacy route and
|
|
* the MCP tools use, so behaviour — including the shared in-memory cache and the
|
|
* Open-Meteo calls — is identical. No logic is duplicated; the upstream service
|
|
* stays the single source of truth (still consumed by the MCP weather tools).
|
|
*/
|
|
@Injectable()
|
|
export class WeatherService {
|
|
get(lat: string, lng: string, date: string | undefined, lang: string): Promise<WeatherResult> {
|
|
return getWeather(lat, lng, date, lang);
|
|
}
|
|
|
|
getDetailed(lat: string, lng: string, date: string, lang: string): Promise<WeatherResult> {
|
|
return getDetailedWeather(lat, lng, date, lang);
|
|
}
|
|
}
|