Class QueueController

java.lang.Object
com.iu.javadatastructureslab.controller.QueueController

@Controller public class QueueController extends Object
Handles the restaurant queue demo endpoints.
  • Constructor Details

    • QueueController

      public QueueController()
  • Method Details

    • queue

      @GetMapping("/queue") public String queue(org.springframework.ui.Model model)
      Renders the queue view with current queue statistics.
      Parameters:
      model - model used to expose view attributes
      Returns:
      the queue view name
    • addToQueue

      @PostMapping("/queue/add") public String addToQueue(@RequestParam String name, @RequestParam String arrivalTime, @RequestParam int priority)
      Adds a customer to the queue.
      Parameters:
      name - customer name
      arrivalTime - arrival time text
      priority - priority flag (0 regular, >0 priority)
      Returns:
      redirect to the queue view
    • removeFromQueue

      @PostMapping("/queue/remove") public String removeFromQueue()
      Removes the next customer from the queue.
      Returns:
      redirect to the queue view
    • clearQueue

      @PostMapping("/queue/clear") public String clearQueue()
      Clears all customers from the queue.
      Returns:
      redirect to the queue view