source: src/main/java/com/example/moviezone/service/Impl/EventServiceImpl.java@ 9eba1fb

Last change on this file since 9eba1fb was 0fb69cc, checked in by DenicaKj <dkorvezir@…>, 22 months ago

Adding Events To Home Page

  • Property mode set to 100644
File size: 859 bytes
Line 
1package com.example.moviezone.service.Impl;
2
3import com.example.moviezone.model.Event;
4import com.example.moviezone.repository.EventRepository;
5import com.example.moviezone.service.EventService;
6import org.springframework.stereotype.Service;
7
8import java.time.LocalDate;
9import java.util.List;
10
11@Service
12public 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,String img_url) {
26 return eventRepository.save(new Event(theme,duration,repeating,start_date,img_url));
27 }
28}
Note: See TracBrowser for help on using the repository browser.