Class ClassService

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

@Service public class ClassService extends Object
The app logic for anything related to classes
  • Constructor Details

    • ClassService

      @Autowired public ClassService(ClassRepository classRepository)
  • Method Details

    • getAllClasses

      public List<RMCClass> getAllClasses()
      Fetches all classes in the database
      Returns:
      A list of all classes
    • addClass

      public RMCClass addClass(String className)
      Adds a class to the database
      Parameters:
      className - the name of the class
      Returns:
      the class
    • getById

      public RMCClass getById(long id)
      Fetches a class by its ID
      Parameters:
      id - the ID of the class
      Returns:
      the class with that ID
    • getClassReviews

      public Set<Review> getClassReviews(long id)
      Fetch the reviews of a class
      Parameters:
      id - the ID of the class
      Returns:
      a Set with the reviews of that class
    • getTextReviews

      public Set<TextReview> getTextReviews(long id)
      Fetch the reviews with text of a class
      Parameters:
      id - the ID of the class
      Returns:
      a Set with the textreviews of that class
    • deleteClass

      public void deleteClass(long id)
      Deletes a class.
      Parameters:
      id - the ID of the class.
    • generateClasses

      public void generateClasses()
      Generates some classes, and adds them to the database.