Package one.suhas.rmc.service
Class ReviewService
java.lang.Object
one.suhas.rmc.service.ReviewService
A class to handle the app logic relating to reviews.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a review to the databaseaddReview
(TextReview textReview) Add a textreview to the databaseApprove the object at the top of the review queuevoid
denyTop()
Deny and delete the object of the top of the review queueFetch all reviews in the databaseFetch all textreviews in the databasegetReviewById
(long id) Fetch a review by its IDgetTRById
(long id) Fetch a textreview by its IDGet the object at the front of the review queue
-
Constructor Details
-
ReviewService
-
-
Method Details
-
getAllReviews
Fetch all reviews in the database- Returns:
- A list of reviews
-
addReview
Add a review to the database- Parameters:
review
- A review object with the data of the review- Returns:
- The saved review
-
getReviewById
Fetch a review by its ID- Parameters:
id
- the ID of the review- Returns:
- the Review linked to that ID
-
addReview
Add a textreview to the database- Parameters:
textReview
- A textreview object with the data of the review- Returns:
- The saved textreview
-
getAllTextReviews
Fetch all textreviews in the database- Returns:
- A list of textreviews
-
getTRById
Fetch a textreview by its ID- Parameters:
id
- the ID of the textreview- Returns:
- the TextReview linked to that ID
-
peekQueue
Get the object at the front of the review queue- Returns:
- a textreview at the top of the review queue.
-
approveTop
Approve the object at the top of the review queue- Returns:
- the approved textreview
-
denyTop
public void denyTop()Deny and delete the object of the top of the review queue
-