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() {
|
||||
|
||||
|
||||
@@ -11,12 +11,15 @@ import java.util.*;
|
||||
|
||||
public class OrderService {
|
||||
|
||||
private final MenuItemDao menuItemDao = new MenuItemDao();
|
||||
private final OrderDao orderDao = new OrderDao();
|
||||
private final MenuItemDao menuItemDao = new MenuItemDao();
|
||||
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 MenuService menuService = new MenuService();
|
||||
private final Scanner scanner;
|
||||
|
||||
public OrderService(Scanner scanner) {
|
||||
this.scanner = scanner;
|
||||
}
|
||||
public void placeOrder(int userId) {
|
||||
menuService.showMenu();
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ import java.util.Scanner;
|
||||
|
||||
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 Scanner scanner = new Scanner(System.in);
|
||||
private final AuthService authService = new AuthService();
|
||||
private final MenuService menuService = new MenuService();
|
||||
private final OrderService orderService = new OrderService(scanner);
|
||||
|
||||
public void start() {
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user