Updated MenuItem and User, and completed AuthService, MenuService, OrderService and ConsoleMenu.
This commit is contained in:
@@ -1,12 +1,27 @@
|
||||
package dev.service;
|
||||
|
||||
import dev.dao.MenuItemDao;
|
||||
import dev.model.MenuItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MenuService {
|
||||
|
||||
public void showMenu() {
|
||||
final MenuItemDao menuItemDao = new MenuItemDao();
|
||||
|
||||
// TODO:
|
||||
// Display menu items
|
||||
|
||||
List<MenuItem> items = menuItemDao.findAll();
|
||||
if (items.isEmpty()) {
|
||||
System.out.println("The menu is currently empty.");
|
||||
return;
|
||||
}
|
||||
System.out.println("\n===== MENU =====");
|
||||
for (MenuItem item : items) {
|
||||
System.out.printf("[%d] %s - $%.2f (%s)\n", item.getId(), item.getName(), item.getPrice(), item.getCategory());
|
||||
if (item.getDescription() != null) {
|
||||
System.out.println(" " + item.getDescription());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user