Fixed guice

This commit is contained in:
Oskar Rasieński 2026-01-18 16:18:53 +01:00
commit 5312e8d6b4

View file

@ -52,7 +52,7 @@ public class MyModule implements Module {
binder.bind(WebSocketUtils.class).in(Scopes.SINGLETON); binder.bind(WebSocketUtils.class).in(Scopes.SINGLETON);
binder.bind(NutritionDetailsCtrl.class).in(Scopes.SINGLETON); binder.bind(NutritionDetailsCtrl.class).in(Scopes.SINGLETON);
binder.bind(NutritionViewCtrl.class).in(Scopes.SINGLETON); binder.bind(NutritionViewCtrl.class).in(Scopes.SINGLETON);
binder.bind(HttpClient.class).in(Scopes.SINGLETON); binder.bind(HttpClient.class).toInstance(HttpClient.newHttpClient());
binder.bind(ConfigService.class).toInstance(new ConfigService(Path.of("config.json"))); binder.bind(ConfigService.class).toInstance(new ConfigService(Path.of("config.json")));
binder.bind(new TypeLiteral<WebSocketDataService<Long, Recipe>>() {}).toInstance( binder.bind(new TypeLiteral<WebSocketDataService<Long, Recipe>>() {}).toInstance(
new WebSocketDataService<>() new WebSocketDataService<>()