Rev | Line | |
---|
[43a1688] | 1 | package com.example.moviezone.service.Impl;
|
---|
| 2 |
|
---|
[73f0dbc] | 3 | import com.example.moviezone.model.manytomany.CustomerRatesFilm;
|
---|
[43a1688] | 4 | import com.example.moviezone.repository.CustomerRatesFilmRepository;
|
---|
| 5 | import com.example.moviezone.service.CustomerRatesFilmService;
|
---|
| 6 | import org.springframework.stereotype.Service;
|
---|
| 7 |
|
---|
| 8 | @Service
|
---|
| 9 | public class CustomerRatesFilmImpl implements CustomerRatesFilmService {
|
---|
| 10 | private final CustomerRatesFilmRepository customerRatesFilmRepository;
|
---|
| 11 |
|
---|
| 12 | public CustomerRatesFilmImpl(CustomerRatesFilmRepository customerRatesFilmRepository) {
|
---|
| 13 | this.customerRatesFilmRepository = customerRatesFilmRepository;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | @Override
|
---|
| 17 | public double avg_rating(int id) {
|
---|
| 18 | return customerRatesFilmRepository.avg_rating(id);
|
---|
| 19 | }
|
---|
[73f0dbc] | 20 |
|
---|
| 21 | @Override
|
---|
| 22 | public CustomerRatesFilm addRating(Integer id_customer, Integer id_film, double rating) {
|
---|
| 23 | CustomerRatesFilm customerRatesFilm=new CustomerRatesFilm(id_customer,id_film,rating);
|
---|
| 24 | return customerRatesFilmRepository.save(customerRatesFilm);
|
---|
| 25 | }
|
---|
[43a1688] | 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.