Changes in / [cb5debb:3650316]


Ignore:
Location:
src/main
Files:
5 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/repository/ProjectionIsPlayedInRoomRepository.java

    rcb5debb r3650316  
    55import org.springframework.data.jpa.repository.JpaRepository;
    66
    7 import java.util.List;
    8 
    97public interface ProjectionIsPlayedInRoomRepository extends JpaRepository<ProjectionIsPlayedInRoom, ProjectionIsPlayedInRoomId> {
    10     List<ProjectionIsPlayedInRoom> findAllById_projection(Integer id_projection);
    118}
  • src/main/java/com/example/moviezone/repository/SeatRepository.java

    rcb5debb r3650316  
    11package com.example.moviezone.repository;
    22
    3 import com.example.moviezone.model.Projection_Room;
    43import com.example.moviezone.model.Seat;
    54import org.springframework.data.jpa.repository.JpaRepository;
    65import org.springframework.stereotype.Repository;
    76
    8 import java.util.List;
    9 
    107@Repository
    118public interface SeatRepository extends JpaRepository<Seat,Integer> {
    12     List<Seat> findAllByProjection_room(Projection_Room projection_room);
    139}
  • src/main/java/com/example/moviezone/service/Impl/ProjectionServiceImpl.java

    rcb5debb r3650316  
    2525    }
    2626
    27     @Override
    28     public Projection findById(Integer id_projection) {
    29         return projectionRepository.findById(id_projection).orElseThrow(RuntimeException::new);
    30     }
    31 
    3227
    3328    @Override
  • src/main/java/com/example/moviezone/service/ProjectionService.java

    rcb5debb r3650316  
    99public interface ProjectionService {
    1010    List<Projection> findAllProjections();
    11     Projection findById(Integer id_projection);
    1211Projection save(LocalDate date_time_start,LocalDate date_time_end, String type_of_technology, Integer id_film );
    1312}
  • src/main/java/com/example/moviezone/web/HomeController.java

    rcb5debb r3650316  
    44import com.example.moviezone.model.*;
    55import com.example.moviezone.model.exceptions.PasswordsDoNotMatchException;
    6 import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoom;
    7 import com.example.moviezone.repository.ProjectionIsPlayedInRoomRepository;
    86import com.example.moviezone.service.*;
    97import org.springframework.format.annotation.DateTimeFormat;
     
    3129private final CinemaOrganizesEventService cinemaOrganizesEventService;
    3230private final CinemaPlaysFilmService cinemaPlaysFilmService;
    33 private final ProjectionIsPlayedInRoomRepository projectionIsPlayedInRoomRepository;
    34 
    35 
    36     public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService, CinemaPlaysFilmService cinemaPlaysFilmService, ProjectionIsPlayedInRoomRepository projectionIsPlayedInRoomRepository) {
     31
     32    public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService, CinemaPlaysFilmService cinemaPlaysFilmService) {
    3733       
    3834        this.filmService = filmService;
     
    4642        this.cinemaOrganizesEventService = cinemaOrganizesEventService;
    4743        this.cinemaPlaysFilmService = cinemaPlaysFilmService;
    48         this.projectionIsPlayedInRoomRepository = projectionIsPlayedInRoomRepository;
    4944    }
    5045
     
    254249        return "redirect:/home";
    255250    }
    256 
    257     @GetMapping("/getProjection/{id}")
    258     public String getProjection(@PathVariable Integer id_projection,Model model)
    259     {
    260         List<Projection_Room> projectionRooms = null;
    261         Projection projection=projectionService.findById(id_projection);
    262 
    263 
    264         List<ProjectionIsPlayedInRoom> p= projectionIsPlayedInRoomRepository.findAllById_projection(id_projection);
    265 
    266         model.addAttribute("projection",projection);
    267         model.addAttribute("p_rooms",projectionRooms);
    268         model.addAttribute("bodyContent","projectionDetails");
    269         return "master-template";
    270     }
    271 
    272     @PostMapping("/makeReservation")
    273     public String createTicketForReservation()
    274     {
    275         return "redirect:/myTickets";
    276     }
    277 
    278251}
Note: See TracChangeset for help on using the changeset viewer.