Interface CustomerReviewService
- All Known Implementing Classes:
DefaultCustomerReviewService
public interface CustomerReviewService
Service managing customer reviews.
- Spring Bean ID:
- customerReviewService
-
Method Summary
Modifier and TypeMethodDescriptioncreateCustomerReview(Double rating, String headline, String comment, UserModel user, ProductModel product) Creates a new customer review based on the given parametersgetAverageRating(ProductModel product) Returns the average rating of all reviews for the given product.getNumberOfReviews(ProductModel product) Returns the number of reviews for the given productgetReviewsForCustomer(UserModel userModel) Get the reviews for the specified customer.getReviewsForProduct(ProductModel product) Get the reviews for the specified product.getReviewsForProductAndLanguage(ProductModel product, LanguageModel language) Get the reviews for the specified product in the specified language.
-
Method Details
-
createCustomerReview
CustomerReviewModel createCustomerReview(Double rating, String headline, String comment, UserModel user, ProductModel product) Creates a new customer review based on the given parameters- Parameters:
rating- the ratingheadline- the headlinecomment- the commentsuser- the user who created the reviewproduct- the product reviewed- Returns:
- the newly created review
-
getAverageRating
Returns the average rating of all reviews for the given product.- Parameters:
product- the product- Returns:
- the average rating
-
getNumberOfReviews
Returns the number of reviews for the given product- Parameters:
product- instance ofProductModelto find the number of reviews for- Returns:
- the number of reviews
-
getReviewsForProduct
Get the reviews for the specified product. Gets all the reviews in any language. (Reviews are restricted by approval status) The reviews are ordered by creation date with the most recent first.- Parameters:
product- the product- Returns:
- the reviews
-
getReviewsForCustomer
Get the reviews for the specified customer. Gets all the reviews in any language. (Reviews are restricted by approval status) The reviews are ordered by created date with the most recent first.- Parameters:
userModel- the customer- Returns:
- the reviews
-
getReviewsForProductAndLanguage
List<CustomerReviewModel> getReviewsForProductAndLanguage(ProductModel product, LanguageModel language) Get the reviews for the specified product in the specified language. The reviews are ordered by creation date with the most recent first.- Parameters:
product- the productlanguage- the language- Returns:
- the reviews
-