Changeset a554435 for src/main/java/com/example/moviezone/web
- Timestamp:
- 02/04/23 19:55:16 (22 months ago)
- Branches:
- master
- Children:
- 302b233, 4ee640e
- Parents:
- e097c1c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/web/HomeController.java
re097c1c ra554435 4 4 import com.example.moviezone.model.User; 5 5 import com.example.moviezone.model.exceptions.UserNotFoundException; 6 import com.example.moviezone.service.EventService; 6 7 import com.example.moviezone.service.FilmService; 8 import com.example.moviezone.service.ProjectionService; 7 9 import com.example.moviezone.service.UserService; 8 10 import org.springframework.stereotype.Controller; … … 14 16 15 17 import javax.servlet.http.HttpSession; 18 import java.time.LocalDate; 16 19 17 20 @Controller … … 21 24 private final FilmService filmService; 22 25 private final UserService userService; 26 private final ProjectionService projectionService; 27 private final EventService eventService; 23 28 24 public HomeController(FilmService filmService, UserService userService ) {29 public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService) { 25 30 this.filmService = filmService; 26 31 this.userService = userService; 32 this.projectionService = projectionService; 33 this.eventService = eventService; 27 34 } 28 35 … … 77 84 } 78 85 86 @GetMapping("/films") 87 public String getFilmsPage(Model model){ 88 model.addAttribute("films",filmService.findAllFilms()); 89 model.addAttribute("bodyContent","films"); 90 return "master-template"; 91 } 92 93 @GetMapping("/projections") 94 public String getProjectionsPage(Model model) 95 { 96 model.addAttribute("projections",projectionService.findAllAvailableProjections(LocalDate.now())); 97 model.addAttribute("bodyContent","projections"); 98 return "master-template"; 99 } 100 @GetMapping("/events") 101 public String getEventsPage(Model model) 102 { 103 model.addAttribute("events",eventService.findAllEvents()); 104 model.addAttribute("bodyContent","events"); 105 return "master-template"; 106 } 107 79 108 }
Note:
See TracChangeset
for help on using the changeset viewer.