- Timestamp:
- 02/04/23 21:01:13 (22 months ago)
- Branches:
- master
- Children:
- 693f587
- Parents:
- a554435
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/service/Impl/ProjectionServiceImpl.java
ra554435 r302b233 1 1 package com.example.moviezone.service.Impl; 2 2 3 import com.example.moviezone.model.Film; 3 4 import com.example.moviezone.model.Projection; 5 import com.example.moviezone.repository.FilmRepository; 4 6 import com.example.moviezone.repository.ProjectionRepository; 5 7 import com.example.moviezone.service.ProjectionService; … … 12 14 public class ProjectionServiceImpl implements ProjectionService { 13 15 private final ProjectionRepository projectionRepository; 14 15 public ProjectionServiceImpl(ProjectionRepository projectionRepository ) {16 private final FilmRepository filmRepository; 17 public ProjectionServiceImpl(ProjectionRepository projectionRepository, FilmRepository filmRepository) { 16 18 this.projectionRepository = projectionRepository; 19 this.filmRepository = filmRepository; 17 20 } 18 21 … … 27 30 } 28 31 32 @Override 33 public Projection save(LocalDate date_time_start, LocalDate date_time_end, String type_of_technology, Integer id_film) { 34 Film film=filmRepository.findById(id_film).orElseThrow(RuntimeException::new); 35 return projectionRepository.save(new Projection(date_time_start,type_of_technology,date_time_end,film)); 36 } 37 29 38 }
Note:
See TracChangeset
for help on using the changeset viewer.