source: src/main/java/com/example/villadihovo/web/controller/ControllersForAllReservations/BeverageReservationsController.java

Last change on this file was f7c05a1, checked in by Elena Shulevska <elena.shulevska@…>, 15 months ago

initial commit of the source code on origin

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package com.example.villadihovo.web.controller.ControllersForAllReservations;
2
3import com.example.villadihovo.dto.ServiceForBeveragesDto;
4import com.example.villadihovo.service.reservation.ServiceForBeveragesService;
5import lombok.AllArgsConstructor;
6import org.springframework.beans.factory.annotation.Autowired;
7import org.springframework.stereotype.Controller;
8import org.springframework.ui.Model;
9import org.springframework.web.bind.annotation.GetMapping;
10import org.springframework.web.bind.annotation.RequestMapping;
11import org.springframework.web.bind.annotation.RestController;
12import org.springframework.web.servlet.ModelAndView;
13
14import java.util.List;
15
16@Controller
17@AllArgsConstructor
18@RequestMapping("/reservations/beverage")
19public class BeverageReservationsController {
20
21 @Autowired
22 private ServiceForBeveragesService serviceForBeveragesService;
23
24 @GetMapping
25 public String listAllBeverageReservations(Model model){
26 List<ServiceForBeveragesDto> allBeverageReservations = this.serviceForBeveragesService.findAllServiceForBeverages();
27 model.addAttribute("beverageReservations", allBeverageReservations);
28 return "beverage-reservations";
29 }
30
31}
Note: See TracBrowser for help on using the repository browser.