Changeset 0fb69cc for src/main/java/com/example
- Timestamp:
- 02/06/23 20:10:28 (23 months ago)
- Branches:
- master
- Children:
- d09caa7
- Parents:
- b5ce654
- Location:
- src/main/java/com/example/moviezone
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/model/Event.java
rb5ce654 r0fb69cc 24 24 String duration; 25 25 String repeating; 26 26 String img_url; 27 27 LocalDate start_date; 28 28 29 public Event(String theme, String duration, String repeating, LocalDate start_date ) {29 public Event(String theme, String duration, String repeating, LocalDate start_date,String img_url) { 30 30 this.theme = theme; 31 31 this.duration = duration; 32 this.img_url=img_url; 32 33 this.repeating = repeating; 33 34 this.start_date = start_date; … … 37 38 38 39 } 40 39 41 } -
src/main/java/com/example/moviezone/service/EventService.java
rb5ce654 r0fb69cc 8 8 public interface EventService { 9 9 List<Event> findAllEvents(); 10 Event save(LocalDate start_date,String theme,String duration,String repeating );10 Event save(LocalDate start_date,String theme,String duration,String repeating,String url); 11 11 } -
src/main/java/com/example/moviezone/service/Impl/EventServiceImpl.java
rb5ce654 r0fb69cc 23 23 24 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 ));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 27 } 28 28 } -
src/main/java/com/example/moviezone/web/HomeController.java
rb5ce654 r0fb69cc 2 2 3 3 4 import com.example.moviezone.model.Customer; 5 import com.example.moviezone.model.Film; 6 import com.example.moviezone.model.Role; 7 import com.example.moviezone.model.User; 4 import com.example.moviezone.model.*; 8 5 import com.example.moviezone.model.exceptions.PasswordsDoNotMatchException; 9 6 import com.example.moviezone.model.exceptions.UserNotFoundException; … … 45 42 List<Film> films=filmService.findAllFilms(); 46 43 films=films.stream().limit(5).collect(Collectors.toList()); 44 List <Event> events=eventService.findAllEvents().stream().limit(5).collect(Collectors.toList()); 47 45 model.addAttribute("films", films); 46 model.addAttribute("events",events); 48 47 model.addAttribute("bodyContent", "home"); 49 48 … … 177 176 @RequestParam String theme, 178 177 @RequestParam String duration, 178 @RequestParam String img_url, 179 179 @RequestParam String repeating) 180 180 { 181 eventService.save(start_date,theme,duration,repeating );181 eventService.save(start_date,theme,duration,repeating,img_url); 182 182 return "redirect:/home"; 183 183 }
Note:
See TracChangeset
for help on using the changeset viewer.