Interface CustomerReviewService
-
- All Known Implementing Classes:
DefaultCustomerReviewService
public interface CustomerReviewServiceService managing customer reviews.- Spring Bean ID:
- customerReviewService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CustomerReviewModelcreateCustomerReview(java.lang.Double rating, java.lang.String headline, java.lang.String comment, UserModel user, ProductModel product)Creates a new customer review based on the given parametersjava.lang.DoublegetAverageRating(ProductModel product)Returns the average rating of all reviews for the given product.java.lang.IntegergetNumberOfReviews(ProductModel product)Returns the number of reviews for the given productjava.util.List<CustomerReviewModel>getReviewsForCustomer(UserModel userModel)Get the reviews for the specified customer.java.util.List<CustomerReviewModel>getReviewsForProduct(ProductModel product)Get the reviews for the specified product.java.util.List<CustomerReviewModel>getReviewsForProductAndLanguage(ProductModel product, LanguageModel language)Get the reviews for the specified product in the specified language.
-
-
-
Method Detail
-
createCustomerReview
CustomerReviewModel createCustomerReview(java.lang.Double rating, java.lang.String headline, java.lang.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
java.lang.Double getAverageRating(ProductModel product)
Returns the average rating of all reviews for the given product.- Parameters:
product- the product- Returns:
- the average rating
-
getNumberOfReviews
java.lang.Integer getNumberOfReviews(ProductModel product)
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
java.util.List<CustomerReviewModel> getReviewsForProduct(ProductModel product)
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
java.util.List<CustomerReviewModel> getReviewsForCustomer(UserModel userModel)
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
java.util.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
-
-