complete consoleMenu class
This commit is contained in:
@@ -6,11 +6,11 @@ import java.sql.SQLException;
|
||||
|
||||
public class DatabaseConnection {
|
||||
|
||||
private static final String URL = "jdbc:postgresql://localhost:5432/restaurant_db"; // DB Server
|
||||
private static final String URL = "jdbc:postgresql://localhost:5432/restaurant_db";
|
||||
|
||||
private static final String USER = "postgres"; // Your Username
|
||||
private static final String USER = "postgres";
|
||||
|
||||
private static final String PASSWORD = "password"; // Your Password
|
||||
private static final String PASSWORD = "password";
|
||||
|
||||
private DatabaseConnection() {
|
||||
|
||||
|
||||
@@ -15,8 +15,11 @@ public class OrderService {
|
||||
private final OrderDao orderDao = new OrderDao();
|
||||
private final OrderDetailDao orderDetailDao = new OrderDetailDao();
|
||||
private final MenuService menuService = new MenuService();
|
||||
private final Scanner scanner = new Scanner(System.in);
|
||||
private final Scanner scanner;
|
||||
|
||||
public OrderService(Scanner scanner) {
|
||||
this.scanner = scanner;
|
||||
}
|
||||
public void placeOrder(int userId) {
|
||||
menuService.showMenu();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class ConsoleMenu {
|
||||
private final Scanner scanner = new Scanner(System.in);
|
||||
private final AuthService authService = new AuthService();
|
||||
private final MenuService menuService = new MenuService();
|
||||
private final OrderService orderService = new OrderService();
|
||||
private final OrderService orderService = new OrderService(scanner);
|
||||
|
||||
public void start() {
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user