Changeset 03fd098 for src/main/java/com/example
- Timestamp:
- 02/07/23 14:30:24 (23 months ago)
- Branches:
- master
- Children:
- 3242ef4
- Parents:
- fc448f5
- Location:
- src/main/java/com/example/moviezone
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/model/manytomany/CinemaPlaysFilm.java
rfc448f5 r03fd098 33 33 @Column(name = "id_film") 34 34 Integer id_film; 35 36 public CinemaPlaysFilm(Integer id_cinema,Integer id_film) { 37 this.id_cinema = id_cinema; 38 this.id_film=id_film; 39 } 35 40 } -
src/main/java/com/example/moviezone/web/HomeController.java
rfc448f5 r03fd098 28 28 private final CinemaService cinemaService; 29 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) { 30 private final CinemaPlaysFilmService cinemaPlaysFilmService; 31 32 public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService, CinemaPlaysFilmService cinemaPlaysFilmService) { 32 33 this.filmService = filmService; 33 34 this.userService = userService; … … 39 40 this.cinemaService = cinemaService; 40 41 this.cinemaOrganizesEventService = cinemaOrganizesEventService; 42 this.cinemaPlaysFilmService = cinemaPlaysFilmService; 41 43 } 42 44 … … 230 232 return "redirect:/home"; 231 233 } 232 234 @GetMapping("/addFilmToCinema") 235 public String getCinemaPlaysFilmPage(Model model) 236 { 237 model.addAttribute("cinemas",cinemaService.findAllCinemas()); 238 model.addAttribute("films",filmService.findAllFilms()); 239 model.addAttribute("bodyContent","addFilmToCinema"); 240 return "master-template"; 241 } 242 @PostMapping("/addCinemaPlaysFilm") 243 public String saveCinemaPlaysFilm(@RequestParam Integer id_cinema, 244 @RequestParam Integer id_film) 245 { 246 cinemaPlaysFilmService.save(id_cinema,id_film); 247 return "redirect:/home"; 248 } 233 249 }
Note:
See TracChangeset
for help on using the changeset viewer.