- Timestamp:
- 02/07/23 14:21:14 (22 months ago)
- Branches:
- master
- Children:
- 03fd098
- Parents:
- d7f5da9
- Location:
- src/main
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/model/manytomany/CinemaOrganizesEvent.java
rd7f5da9 rfc448f5 28 28 @Id 29 29 Integer id_event; 30 31 public CinemaOrganizesEvent(Integer id_cinema, Integer id_event) { 32 this.id_cinema=id_cinema; 33 this.id_event=id_event; 34 } 30 35 } -
src/main/java/com/example/moviezone/web/HomeController.java
rd7f5da9 rfc448f5 4 4 import com.example.moviezone.model.*; 5 5 import com.example.moviezone.model.exceptions.PasswordsDoNotMatchException; 6 import com.example.moviezone.model.exceptions.UserNotFoundException;7 6 import com.example.moviezone.service.*; 8 7 import org.springframework.format.annotation.DateTimeFormat; … … 27 26 private final WorkerService workerService; 28 27 private final CustomerRatesFilmService customerRatesFilmService; 29 30 public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService) { 28 private final CinemaService cinemaService; 29 private final CinemaOrganizesEventService cinemaOrganizesEventService; 30 31 public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService) { 31 32 this.filmService = filmService; 32 33 this.userService = userService; … … 36 37 this.workerService = workerService; 37 38 this.customerRatesFilmService = customerRatesFilmService; 39 this.cinemaService = cinemaService; 40 this.cinemaOrganizesEventService = cinemaOrganizesEventService; 38 41 } 39 42 … … 152 155 return "master-template"; 153 156 } 157 158 154 159 @GetMapping("/addEvent") 155 160 public String getAddEventPage(Model model) … … 208 213 return "master-template"; 209 214 } 215 216 @GetMapping("/addEventToCinema") 217 public String getCinemaOrganizesEventPage(Model model) 218 { 219 model.addAttribute("cinemas",cinemaService.findAllCinemas()); 220 model.addAttribute("events",eventService.findAllEvents()); 221 model.addAttribute("bodyContent","addEventToCinema"); 222 return "master-template"; 223 } 224 @PostMapping("/addCinemaOrganizesEvent") 225 public String saveCinemaOrganizesEvent(@RequestParam Integer id_cinema, 226 @RequestParam Integer id_event) 227 { 228 229 cinemaOrganizesEventService.save(id_cinema,id_event); 230 return "redirect:/home"; 231 } 232 210 233 }
Note:
See TracChangeset
for help on using the changeset viewer.