Server/project/src/callbacks/WeatherCallbacks.ts

27 lines
962 B
TypeScript
Raw Normal View History

2023-03-03 16:23:46 +01:00
import { inject, injectable } from "tsyringe";
import { WeatherController } from "@spt-aki/controllers/WeatherController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { IWeatherData } from "@spt-aki/models/eft/weather/IWeatherData";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
2023-03-03 16:23:46 +01:00
@injectable()
export class WeatherCallbacks
{
constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
2023-11-16 02:35:05 +01:00
@inject("WeatherController") protected weatherController: WeatherController,
2023-03-03 16:23:46 +01:00
)
2023-11-16 02:35:05 +01:00
{}
2023-03-03 16:23:46 +01:00
/**
* Handle client/weather
* @returns IWeatherData
*/
public getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IWeatherData>
{
return this.httpResponse.getBody(this.weatherController.generate());
}
2023-11-16 02:35:05 +01:00
}