Last change
on this file was 5444409, checked in by milamihajlovska <mila.mihajlovska01@…>, 21 months ago |
update register and registerWorker
|
-
Property mode
set to
100644
|
File size:
785 bytes
|
Rev | Line | |
---|
[11dea8f] | 1 | package com.example.moviezone.service.Impl;
|
---|
| 2 |
|
---|
| 3 | import com.example.moviezone.model.Cinema;
|
---|
[f60cb20] | 4 | import com.example.moviezone.repository.CinemaRepository;
|
---|
[11dea8f] | 5 | import com.example.moviezone.service.CinemaService;
|
---|
| 6 | import org.springframework.stereotype.Service;
|
---|
| 7 |
|
---|
| 8 | import java.util.List;
|
---|
| 9 |
|
---|
| 10 | @Service
|
---|
| 11 | public class CinemaServiceImpl implements CinemaService {
|
---|
[f60cb20] | 12 | private final CinemaRepository cinemaRepository;
|
---|
| 13 |
|
---|
| 14 | public CinemaServiceImpl(CinemaRepository cinemaRepository) {
|
---|
| 15 | this.cinemaRepository = cinemaRepository;
|
---|
| 16 | }
|
---|
| 17 |
|
---|
[11dea8f] | 18 | @Override
|
---|
| 19 | public List<Cinema> findAllCinemas() {
|
---|
[1b248e4] | 20 | return cinemaRepository.findAll();
|
---|
[11dea8f] | 21 | }
|
---|
[5444409] | 22 |
|
---|
| 23 | @Override
|
---|
| 24 | public Cinema findCinemaById(Integer id_cinema) {
|
---|
| 25 | return cinemaRepository.findById(id_cinema).orElseThrow(RuntimeException::new);
|
---|
| 26 | }
|
---|
[11dea8f] | 27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.