2023-11-05 10:39:39 +01:00
|
|
|
package catering.order;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
2023-11-05 12:33:43 +01:00
|
|
|
import org.springframework.ui.Model;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
2023-11-05 10:39:39 +01:00
|
|
|
|
|
|
|
@Controller
|
|
|
|
public class OrderController {
|
|
|
|
|
2023-11-05 12:33:43 +01:00
|
|
|
private final CustomOrderRepository orderRepository;
|
|
|
|
|
|
|
|
public OrderController(CustomOrderRepository orderRepository) {
|
|
|
|
this.orderRepository = orderRepository;
|
|
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/orders")
|
|
|
|
public String orders(Model model) {
|
|
|
|
model.addAttribute("total", orderRepository.getOrders().size());
|
|
|
|
return "orders";
|
|
|
|
}
|
2023-11-05 10:39:39 +01:00
|
|
|
}
|