Changeset 302b233 for src/main/java/com/example/moviezone/service/Impl
- Timestamp:
- 02/04/23 21:01:13 (22 months ago)
- Branches:
- master
- Children:
- 693f587
- Parents:
- a554435
- Location:
- src/main/java/com/example/moviezone/service/Impl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/service/Impl/EventServiceImpl.java
ra554435 r302b233 6 6 import org.springframework.stereotype.Service; 7 7 8 import java.time.LocalDate; 8 9 import java.util.List; 9 10 … … 20 21 return eventRepository.findAll(); 21 22 } 23 24 @Override 25 public Event save(LocalDate start_date, String theme, String duration, String repeating) { 26 return eventRepository.save(new Event(theme,duration,repeating,start_date)); 27 } 22 28 } -
src/main/java/com/example/moviezone/service/Impl/FilmServiceImpl.java
ra554435 r302b233 6 6 import org.springframework.stereotype.Service; 7 7 8 import java.time.LocalDate; 8 9 import java.util.List; 9 10 … … 20 21 return filmRepository.findAll(); 21 22 } 23 24 @Override 25 public Film save(String name, Integer duration, String actors, String genre, String age_category, String url, String director, LocalDate start_date, LocalDate end_date) { 26 return filmRepository.save(new Film(name,duration,actors,genre,age_category,url,director,start_date,end_date)); 27 } 22 28 } -
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.