Package balu.pizza.webapp.controllers
Class CafesController
java.lang.Object
balu.pizza.webapp.controllers.CafesController
Cafe Controller
-
Constructor Summary
ConstructorDescriptionCafesController
(PizzaService pizzaService, CafeService cafeService, UserUtil userUtil) -
Method Summary
Modifier and TypeMethodDescriptionindexPage
(org.springframework.ui.Model model) Main page cafe sectionpizzaAvailability
(int pizzaId, org.springframework.ui.Model model) The page displays the presence of pizza in the cafe menushowCafe
(int cafeId, org.springframework.ui.Model model) Page displaying information about the cafe and its menu
-
Constructor Details
-
CafesController
@Autowired public CafesController(PizzaService pizzaService, CafeService cafeService, UserUtil userUtil) - Parameters:
pizzaService
- Pizza servicecafeService
- Cafe serviceuserUtil
- Set users utils
-
-
Method Details
-
indexPage
Main page cafe section- Parameters:
model
-- Returns:
- Generates a page for the route /cafe
-
pizzaAvailability
@GetMapping("/pizza/{pizzaId}") public String pizzaAvailability(@PathVariable("pizzaId") int pizzaId, org.springframework.ui.Model model) The page displays the presence of pizza in the cafe menu- Parameters:
pizzaId
-model
-- Returns:
- Generates a page for the route /cafe/pizza/id
-
showCafe
@GetMapping("/{id}") public String showCafe(@PathVariable("id") int cafeId, org.springframework.ui.Model model) Page displaying information about the cafe and its menu- Parameters:
cafeId
- cafe identifiermodel
-- Returns:
- Generates a page for the route /cafe/id
-