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 | |
---|
1 | package com.example.villadihovo.web.controller.ControllersForAllReservations;
|
---|
2 |
|
---|
3 | import com.example.villadihovo.dto.ReservationForFoodDto;
|
---|
4 | import com.example.villadihovo.service.reservation.ReservationForPreparedMealService;
|
---|
5 | import lombok.AllArgsConstructor;
|
---|
6 | import org.springframework.beans.factory.annotation.Autowired;
|
---|
7 | import org.springframework.stereotype.Controller;
|
---|
8 | import org.springframework.ui.Model;
|
---|
9 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
10 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
11 | import org.springframework.web.bind.annotation.RestController;
|
---|
12 | import org.springframework.web.servlet.ModelAndView;
|
---|
13 |
|
---|
14 | import java.util.List;
|
---|
15 |
|
---|
16 | @Controller
|
---|
17 | @AllArgsConstructor
|
---|
18 | @RequestMapping("/reservations/food")
|
---|
19 | public class FoodReservationsController {
|
---|
20 |
|
---|
21 | @Autowired
|
---|
22 | private ReservationForPreparedMealService reservationForPreparedMealService;
|
---|
23 |
|
---|
24 | @GetMapping
|
---|
25 | public String listAllPreparedMealReservations(Model model){
|
---|
26 | List<ReservationForFoodDto> allFoodReservations = this.reservationForPreparedMealService.findAllFoodReservations();
|
---|
27 | model.addAttribute("foodReservations", allFoodReservations);
|
---|
28 | return "food-reservations";
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.