Class ShopQueueController

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

@Controller public class ShopQueueController extends Object
Handles order queue simulation endpoints for the shop demo.
  • Constructor Details

    • ShopQueueController

      public ShopQueueController()
  • Method Details

    • shopQueue

      @GetMapping("/shopqueue") public String shopQueue(org.springframework.ui.Model model)
      Renders the shop queue view and exposes queue metrics.
      Parameters:
      model - model used to expose view attributes
      Returns:
      the shop queue view name
    • addOrder

      @PostMapping("/shopqueue/add") public String addOrder(@RequestParam String customerName, @RequestParam String productName, @RequestParam String priority, @RequestParam int orderValue)
      Adds a new order to the queue.
      Parameters:
      customerName - customer name
      productName - product name
      priority - priority level text
      orderValue - order total value
      Returns:
      redirect to the shop queue view
    • processNextOrder

      @PostMapping("/shopqueue/process") public String processNextOrder()
      Processes the next order in the queue.
      Returns:
      redirect to the shop queue view
    • peekNextOrder

      @PostMapping("/shopqueue/peek") public String peekNextOrder()
      Peeks at the next order in the queue without removal.
      Returns:
      redirect to the shop queue view
    • cancelOrder

      @PostMapping("/shopqueue/cancel") public String cancelOrder(@RequestParam int orderId)
      Cancels an order by id.
      Parameters:
      orderId - order identifier
      Returns:
      redirect to the shop queue view
    • completeOrder

      @PostMapping("/shopqueue/complete") public String completeOrder(@RequestParam int orderId)
      Completes an order by id.
      Parameters:
      orderId - order identifier
      Returns:
      redirect to the shop queue view