Class QueueController
java.lang.Object
com.iu.javadatastructureslab.controller.QueueController
Handles the restaurant queue demo endpoints.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddToQueue(String name, String arrivalTime, int priority) Adds a customer to the queue.Clears all customers from the queue.queue(org.springframework.ui.Model model) Renders the queue view with current queue statistics.Removes the next customer from the queue.
-
Constructor Details
-
QueueController
public QueueController()
-
-
Method Details
-
queue
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 namearrivalTime- arrival time textpriority- priority flag (0 regular, >0 priority)- Returns:
- redirect to the queue view
-
removeFromQueue
Removes the next customer from the queue.- Returns:
- redirect to the queue view
-
clearQueue
Clears all customers from the queue.- Returns:
- redirect to the queue view
-