Class ReviewService

java.lang.Object
one.suhas.rmc.service.ReviewService

@Service public class ReviewService extends Object
A class to handle the app logic relating to reviews.
  • Constructor Details

  • Method Details

    • getAllReviews

      public List<Review> getAllReviews()
      Fetch all reviews in the database
      Returns:
      A list of reviews
    • addReview

      public Review addReview(Review review)
      Add a review to the database
      Parameters:
      review - A review object with the data of the review
      Returns:
      The saved review
    • getReviewById

      public Review getReviewById(long id)
      Fetch a review by its ID
      Parameters:
      id - the ID of the review
      Returns:
      the Review linked to that ID
    • addReview

      public TextReview addReview(TextReview textReview)
      Add a textreview to the database
      Parameters:
      textReview - A textreview object with the data of the review
      Returns:
      The saved textreview
    • getAllTextReviews

      public List<TextReview> getAllTextReviews()
      Fetch all textreviews in the database
      Returns:
      A list of textreviews
    • getTRById

      public TextReview getTRById(long id)
      Fetch a textreview by its ID
      Parameters:
      id - the ID of the textreview
      Returns:
      the TextReview linked to that ID
    • peekQueue

      public TextReview peekQueue()
      Get the object at the front of the review queue
      Returns:
      a textreview at the top of the review queue.
    • approveTop

      public TextReview 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