Index: src/main/java/com/example/moviezone/repository/CustomerRatesFilmRepository.java
===================================================================
--- src/main/java/com/example/moviezone/repository/CustomerRatesFilmRepository.java	(revision eb5426c981f83375a15824666dfb19c2aeb9fab7)
+++ src/main/java/com/example/moviezone/repository/CustomerRatesFilmRepository.java	(revision 43a1688664ca4d96cf0cad0430b66a59f21080ea)
@@ -4,7 +4,12 @@
 import com.example.moviezone.model.manytomany.CustomerRatesFilmId;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.query.Procedure;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 @Repository
 public interface CustomerRatesFilmRepository extends JpaRepository<CustomerRatesFilm, CustomerRatesFilmId> {
+@Procedure("project.avg_rating1")
+    double avg_rating(int id);
+
 }
Index: src/main/java/com/example/moviezone/service/CustomerRatesFilmService.java
===================================================================
--- src/main/java/com/example/moviezone/service/CustomerRatesFilmService.java	(revision 43a1688664ca4d96cf0cad0430b66a59f21080ea)
+++ src/main/java/com/example/moviezone/service/CustomerRatesFilmService.java	(revision 43a1688664ca4d96cf0cad0430b66a59f21080ea)
@@ -0,0 +1,5 @@
+package com.example.moviezone.service;
+
+public interface CustomerRatesFilmService {
+    double avg_rating(int id);
+}
Index: src/main/java/com/example/moviezone/service/Impl/CustomerRatesFilmImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/CustomerRatesFilmImpl.java	(revision 43a1688664ca4d96cf0cad0430b66a59f21080ea)
+++ src/main/java/com/example/moviezone/service/Impl/CustomerRatesFilmImpl.java	(revision 43a1688664ca4d96cf0cad0430b66a59f21080ea)
@@ -0,0 +1,19 @@
+package com.example.moviezone.service.Impl;
+
+import com.example.moviezone.repository.CustomerRatesFilmRepository;
+import com.example.moviezone.service.CustomerRatesFilmService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CustomerRatesFilmImpl implements CustomerRatesFilmService {
+    private final CustomerRatesFilmRepository customerRatesFilmRepository;
+
+    public CustomerRatesFilmImpl(CustomerRatesFilmRepository customerRatesFilmRepository) {
+        this.customerRatesFilmRepository = customerRatesFilmRepository;
+    }
+
+    @Override
+    public double avg_rating(int id) {
+        return customerRatesFilmRepository.avg_rating(id);
+    }
+}
Index: src/main/java/com/example/moviezone/web/HomeController.java
===================================================================
--- src/main/java/com/example/moviezone/web/HomeController.java	(revision eb5426c981f83375a15824666dfb19c2aeb9fab7)
+++ src/main/java/com/example/moviezone/web/HomeController.java	(revision 43a1688664ca4d96cf0cad0430b66a59f21080ea)
@@ -15,5 +15,4 @@
 import java.time.LocalDate;
 import java.util.List;
-import java.util.Optional;
 import java.util.stream.Collectors;
 
@@ -28,6 +27,7 @@
 private final TicketService ticketService;
 private final WorkerService workerService;
+private final CustomerRatesFilmService customerRatesFilmService;
 
-    public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService) {
+    public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService) {
         this.filmService = filmService;
         this.userService = userService;
@@ -36,4 +36,5 @@
         this.ticketService = ticketService;
         this.workerService = workerService;
+        this.customerRatesFilmService = customerRatesFilmService;
     }
 
@@ -49,7 +50,10 @@
     @GetMapping("/getFilm/{id}")
     public String getFilm(@PathVariable Long id, Model model) {
-        Optional<Film> film=filmService.getFilmById(id);
+        Film film=filmService.getFilmById(id).get();
         model.addAttribute("film", film);
-        model.addAttribute("bodyContent", "home");
+        List<String> genres= List.of(film.getGenre().split(","));
+        double r=customerRatesFilmService.avg_rating(film.getId_film());
+        model.addAttribute("genres", genres);
+        model.addAttribute("bodyContent", "film");
 
         return "master-template";
