Last change
on this file since eb5426c 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:
836 bytes
|
Line | |
---|
1 | package com.example.moviezone.service.Impl;
|
---|
2 |
|
---|
3 | import com.example.moviezone.model.Event;
|
---|
4 | import com.example.moviezone.repository.EventRepository;
|
---|
5 | import com.example.moviezone.service.EventService;
|
---|
6 | import org.springframework.stereotype.Service;
|
---|
7 |
|
---|
8 | import java.time.LocalDate;
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | @Service
|
---|
12 | public class EventServiceImpl implements EventService {
|
---|
13 | private final EventRepository eventRepository;
|
---|
14 |
|
---|
15 | public EventServiceImpl(EventRepository eventRepository) {
|
---|
16 | this.eventRepository = eventRepository;
|
---|
17 | }
|
---|
18 |
|
---|
19 | @Override
|
---|
20 | public List<Event> findAllEvents() {
|
---|
21 | return eventRepository.findAll();
|
---|
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 | }
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.