Class BookingController
java.lang.Object
springboot.bg.harisauto.web.controller.BookingController
BookingController.java - Controller for handling booking-related web requests.
- Author:
- Kristian Popov
-
Constructor Summary
ConstructorsConstructorDescriptionBookingController(UserService userService, VehicleService vehicleService, ShoppingCart shoppingCart, BookingService bookingService, InvoiceService invoiceService) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.ModelAndViewcreateBooking(AuthenticationMetaData metaData, @Valid BookingFormRequest request, org.springframework.validation.BindingResult result, jakarta.servlet.http.HttpSession session) Create a booking.org.springframework.web.servlet.ModelAndViewshowBookingPage(AuthenticationMetaData metaData) Show booking page.
-
Constructor Details
-
BookingController
public BookingController(UserService userService, VehicleService vehicleService, ShoppingCart shoppingCart, BookingService bookingService, InvoiceService invoiceService) Constructor.
-
-
Method Details
-
showBookingPage
@GetMapping public org.springframework.web.servlet.ModelAndView showBookingPage(@AuthenticationPrincipal AuthenticationMetaData metaData) Show booking page.- Returns:
- The booking page.
-
createBooking
@PostMapping public org.springframework.web.servlet.ModelAndView createBooking(@AuthenticationPrincipal AuthenticationMetaData metaData, @Valid @Valid BookingFormRequest request, org.springframework.validation.BindingResult result, jakarta.servlet.http.HttpSession session) Create a booking.- Parameters:
metaData- Authentication metadatarequest- Booking requestresult- Binding resultsession- Session- Returns:
- Redirect to bookings page
-