Last change
on this file since 4173acf was 73f0dbc, checked in by DenicaKj <dkorvezir@…>, 21 months ago |
added rating
|
-
Property mode
set to
100644
|
File size:
1017 bytes
|
Line | |
---|
1 | package com.example.moviezone.service.Impl;
|
---|
2 |
|
---|
3 | import com.example.moviezone.model.manytomany.CustomerRatesFilm;
|
---|
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 | }
|
---|
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 | }
|
---|
26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.