- Timestamp:
- 02/10/23 19:30:53 (21 months ago)
- Branches:
- master
- Children:
- 11d7b36
- Parents:
- 633b371
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/web/HomeController.java
r633b371 ra8b6e6a 22 22 import java.io.IOException; 23 23 import java.time.LocalDate; 24 import java.util.Collections; 24 25 import java.util.LinkedList; 25 26 import java.util.List; … … 71 72 public String getHomePage(Model model) { 72 73 List<Film> films=filmService.findAllFilms(); 74 Collections.reverse(films); 73 75 films=films.stream().limit(5).collect(Collectors.toList()); 74 List <Event> events=eventService.findAllEvents().stream().limit(5).collect(Collectors.toList()); 76 List <Event> events=eventService.findAllEvents(); 77 Collections.reverse(events); 78 events=events.stream().limit(5).collect(Collectors.toList()); 75 79 model.addAttribute("films", films); 76 80 model.addAttribute("events",events); … … 85 89 List<String> genres= List.of(film.getGenre().split(",")); 86 90 double r=customerRatesFilmService.avg_rating(film.getId_film()); 91 Double ra=Double.valueOf(r); 92 if(ra==null){ 93 r=0; 94 } 87 95 model.addAttribute("rating",r); 88 96 model.addAttribute("genres", genres);
Note:
See TracChangeset
for help on using the changeset viewer.