Class CartController

java.lang.Object
springboot.bg.harisauto.web.controller.CartController

@Controller @RequestMapping("/cart") public class CartController extends Object
CartController.java - Controller for handling shopping cart-related web requests.
Author:
Kristian Popov
  • Constructor Details

    • CartController

      public CartController()
  • Method Details

    • addToCart

      @PostMapping("/add/{id}") public String addToCart(@PathVariable UUID id)
      Add item to the cart.
      Parameters:
      id - The service id.
      Returns:
      The services page.
    • removeFromCart

      @PostMapping("/remove/{id}") public String removeFromCart(@PathVariable UUID id)
      Remove item from the cart.
      Parameters:
      id - The service id.
      Returns:
      The services page.
    • clearCart

      @PostMapping("/clear") public String clearCart()
      Clear the cart.
      Returns:
      The services page.
    • checkout

      @GetMapping("/checkout") public String checkout()
      Checkout the cart.
      Returns:
      The booking page.