use of com.iluwatar.hexagonal.banking.WireTransfers in project java-design-patterns by iluwatar.
the class ConsoleLottery method main.
/**
* Program entry point
*/
public static void main(String[] args) {
MongoConnectionPropertiesLoader.load();
Injector injector = Guice.createInjector(new LotteryModule());
LotteryService service = injector.getInstance(LotteryService.class);
WireTransfers bank = injector.getInstance(WireTransfers.class);
try (final Scanner scanner = new Scanner(System.in)) {
boolean exit = false;
while (!exit) {
printMainMenu();
String cmd = readString(scanner);
if ("1".equals(cmd)) {
queryLotteryAccountFunds(bank, scanner);
} else if ("2".equals(cmd)) {
addFundsToLotteryAccount(bank, scanner);
} else if ("3".equals(cmd)) {
submitTicket(service, scanner);
} else if ("4".equals(cmd)) {
checkTicket(service, scanner);
} else if ("5".equals(cmd)) {
exit = true;
} else {
LOGGER.info("Unknown command");
}
}
}
}
Aggregations