Files
SPT-Server-Build/Core/Routers/Static/WeatherStaticRouter.cs
T
2025-01-13 21:57:04 +00:00

42 lines
1.1 KiB
C#

using Core.Annotations;
using Core.Callbacks;
using Core.DI;
using Core.Models.Eft.Common;
using Core.Utils;
namespace Core.Routers.Static;
[Injectable(InjectableTypeOverride = typeof(StaticRouter))]
public class WeatherStaticRouter : StaticRouter
{
protected static WeatherCallbacks _weatherCallbacks;
public WeatherStaticRouter(
JsonUtil jsonUtil,
WeatherCallbacks weatherCallbacks
) : base(
jsonUtil,
[
new RouteAction(
"/client/weather",
(
url,
info,
sessionID,
output
) => _weatherCallbacks.GetWeather(url, info as EmptyRequestData, sessionID)),
new RouteAction(
"/client/localGame/weather",
(
url,
info,
sessionID,
output
) => _weatherCallbacks.GetLocalWeather(url, info as EmptyRequestData, sessionID)),
]
)
{
_weatherCallbacks = weatherCallbacks;
}
}