complete consoleMenu class
This commit is contained in:
@@ -6,11 +6,11 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
public class DatabaseConnection {
|
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() {
|
private DatabaseConnection() {
|
||||||
|
|
||||||
|
|||||||
@@ -11,12 +11,15 @@ import java.util.*;
|
|||||||
|
|
||||||
public class OrderService {
|
public class OrderService {
|
||||||
|
|
||||||
private final MenuItemDao menuItemDao = new MenuItemDao();
|
private final MenuItemDao menuItemDao = new MenuItemDao();
|
||||||
private final OrderDao orderDao = new OrderDao();
|
private final OrderDao orderDao = new OrderDao();
|
||||||
private final OrderDetailDao orderDetailDao = new OrderDetailDao();
|
private final OrderDetailDao orderDetailDao = new OrderDetailDao();
|
||||||
private final MenuService menuService = new MenuService();
|
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) {
|
public void placeOrder(int userId) {
|
||||||
menuService.showMenu();
|
menuService.showMenu();
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import java.util.Scanner;
|
|||||||
|
|
||||||
public class ConsoleMenu {
|
public class ConsoleMenu {
|
||||||
|
|
||||||
private final Scanner scanner = new Scanner(System.in);
|
private final Scanner scanner = new Scanner(System.in);
|
||||||
private final AuthService authService = new AuthService();
|
private final AuthService authService = new AuthService();
|
||||||
private final MenuService menuService = new MenuService();
|
private final MenuService menuService = new MenuService();
|
||||||
private final OrderService orderService = new OrderService();
|
private final OrderService orderService = new OrderService(scanner);
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user