source: src/main/java/com/example/moviezone/service/Impl/FilmServiceImpl.java@ 533c366

Last change on this file since 533c366 was 302b233, checked in by milamihajlovska <mila.mihajlovska01@…>, 22 months ago

home controller added mappings for add new film, event and projection

  • Property mode set to 100644
File size: 936 bytes
Line 
1package com.example.moviezone.service.Impl;
2
3import com.example.moviezone.model.Film;
4import com.example.moviezone.repository.FilmRepository;
5import com.example.moviezone.service.FilmService;
6import org.springframework.stereotype.Service;
7
8import java.time.LocalDate;
9import java.util.List;
10
11@Service
12public class FilmServiceImpl implements FilmService {
13 private final FilmRepository filmRepository;
14
15 public FilmServiceImpl(FilmRepository filmRepository) {
16 this.filmRepository = filmRepository;
17 }
18
19 @Override
20 public List<Film> findAllFilms() {
21 return filmRepository.findAll();
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 }
28}
Note: See TracBrowser for help on using the repository browser.