39 lines
1.5 KiB
Java
39 lines
1.5 KiB
Java
package csep;
|
|
|
|
import client.scenes.FoodpalApplicationCtrl;
|
|
import client.scenes.MainCtrl;
|
|
import client.scenes.SearchBarCtrl;
|
|
import client.scenes.recipe.IngredientListCtrl;
|
|
import client.scenes.recipe.RecipeStepListCtrl;
|
|
import client.utils.*;
|
|
import com.google.inject.AbstractModule;
|
|
import com.google.inject.Binder;
|
|
import com.google.inject.Module;
|
|
import com.google.inject.Scopes;
|
|
import com.google.inject.TypeLiteral;
|
|
import commons.Ingredient;
|
|
import commons.Recipe;
|
|
|
|
import java.nio.file.Path;
|
|
|
|
public class TestModule implements Module {
|
|
@Override
|
|
public void configure(Binder binder) {
|
|
binder.bind(MainCtrl.class).in(Scopes.SINGLETON);
|
|
binder.bind(FoodpalApplicationCtrl.class).in(Scopes.SINGLETON);
|
|
binder.bind(IngredientListCtrl.class).in(Scopes.SINGLETON);
|
|
binder.bind(RecipeStepListCtrl.class).in(Scopes.SINGLETON);
|
|
binder.bind(SearchBarCtrl.class).in(Scopes.SINGLETON);
|
|
binder.bind(LocaleManager.class).in(Scopes.SINGLETON);
|
|
binder.bind(ServerUtils.class).in(Scopes.SINGLETON);
|
|
binder.bind(WebSocketUtils.class).in(Scopes.SINGLETON);
|
|
|
|
binder.bind(ConfigService.class).toInstance(new ConfigService(Path.of("config.json")));
|
|
binder.bind(new TypeLiteral<WebSocketDataService<Long, Recipe>>() {}).toInstance(
|
|
new WebSocketDataService<>()
|
|
);
|
|
binder.bind(new TypeLiteral<WebSocketDataService<Long, Ingredient>>() {}).toInstance(
|
|
new WebSocketDataService<>()
|
|
);
|
|
}
|
|
}
|