Ignore:
Timestamp:
02/06/23 03:59:41 (22 months ago)
Author:
DenicaKj <dkorvezir@…>
Branches:
master
Children:
f8ef9bd
Parents:
448bd84
Message:

Home Page

Location:
src/main/java/com/example/moviezone/service
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/service/FilmService.java

    r448bd84 reb5426c  
    55import java.time.LocalDate;
    66import java.util.List;
     7import java.util.Optional;
    78
    89public interface FilmService {
     
    1011    Film save(String name, Integer duration, String actors, String genre,
    1112              String age_category, String url, String director, LocalDate start_date,LocalDate end_date);
     13    Optional<Film> getFilmById(Long id);
    1214}
  • src/main/java/com/example/moviezone/service/Impl/FilmServiceImpl.java

    r448bd84 reb5426c  
    77
    88import java.time.LocalDate;
     9import java.util.Collections;
    910import java.util.List;
     11import java.util.Optional;
    1012
    1113@Service
     
    2628        return filmRepository.save(new Film(name,duration,actors,genre,age_category,url,director,start_date,end_date));
    2729    }
     30
     31    @Override
     32    public Optional<Film> getFilmById(Long id) {
     33        return filmRepository.findAllById(Collections.singleton(id.intValue())).stream().findFirst();
     34    }
     35
    2836}
  • src/main/java/com/example/moviezone/service/Impl/ProjectionServiceImpl.java

    r448bd84 reb5426c  
    2525    }
    2626
    27     @Override
    28     public List<Projection> findAllAvailableProjections(LocalDate date) {
    29         return projectionRepository.findAllByDate_time_startBefore(date);
    30     }
    3127
    3228    @Override
  • src/main/java/com/example/moviezone/service/ProjectionService.java

    r448bd84 reb5426c  
    99public interface ProjectionService {
    1010    List<Projection> findAllProjections();
    11 List<Projection> findAllAvailableProjections(LocalDate date);
    1211Projection save(LocalDate date_time_start,LocalDate date_time_end, String type_of_technology, Integer id_film );
    1312}
Note: See TracChangeset for help on using the changeset viewer.