Class ReportController

java.lang.Object
org.codewithmagret.rest.report.ReportController

@RestController @RequestMapping("/api/v1/reports") public class ReportController extends Object
Controller class for handling HTTP requests related to reports.
  • Constructor Details

    • ReportController

      public ReportController()
  • Method Details

    • getCoursesPerCategory

      @GetMapping("/coursesByCategories") public List<CoursesByCategory> getCoursesPerCategory()
      Endpoint to retrieve courses grouped by their categories.
      Returns:
      a list of courses grouped by category
    • getCoursesPerStudent

      @GetMapping("/coursesByStudents") public List<CoursesByStudent> getCoursesPerStudent()
      Endpoint to retrieve courses grouped by students.
      Returns:
      a list of courses grouped by students
    • getInstructorsByCourses

      @GetMapping("/instructorsByCourses") public List<InstructorByCourse> getInstructorsByCourses()
      Endpoint to retrieve instructors by courses.
      Returns:
      the total number of courses
    • instructorsByStudent

      @GetMapping("/instructorsByStudents") public List<InstructorsByStudent> instructorsByStudent()
      Endpoint to retrieve instructors by students.
      Returns:
      a list of instructors grouped by students