Class TutorController

java.lang.Object
org.example.crmedu.application.controller.TutorController

@RestController @RequestMapping("api/v1/tutors") public class TutorController extends Object
REST controller for managing tutors. Provides endpoints to create, retrieve, update and delete tutors.
  • Constructor Details

    • TutorController

      public TutorController()
  • Method Details

    • getTutors

      @GetMapping @Secured({"SUPERUSER","ORG_ADMIN","CURATOR"}) public org.springframework.http.ResponseEntity<PageDTO<GetTutorResponse>> getTutors(org.springframework.data.domain.Pageable pageable)
      Retrieves a paginates list of tutors.
      Parameters:
      pageable - an object specifying pagination parameters (page number and size)
      Returns:
      a ResponseEntity containing a paginated list of tutors wrapped in PageDTO of GetTutorResponse
    • createTutors

      @PostMapping @Secured({"SUPERUSER","ORG_ADMIN","CURATOR"}) public org.springframework.http.ResponseEntity<CreateTutorResponse> createTutors(@Valid @RequestBody @Valid CreateTutorRequest request)
      Creates a new tutor based on the provided request data.
      Parameters:
      request - an object containing the tutor details
      Returns:
      a ResponseEntity with the created tutor data in CreateTutorResponse
    • getTutor

      @GetMapping("/{id}") @Secured({"SUPERUSER","ORG_ADMIN","CURATOR"}) public org.springframework.http.ResponseEntity<GetTutorResponse> getTutor(@PathVariable Long id)
      Retrieves a tutor by its unique identifier.
      Parameters:
      id - the unique identifier of the tutor
      Returns:
      a ResponseEntity containing the tutor data in GetTutorResponse
    • updateTutor

      @PutMapping("/{id}") @Secured({"SUPERUSER","ORG_ADMIN","CURATOR"}) public org.springframework.http.ResponseEntity<Void> updateTutor(@Valid @RequestBody @Valid UpdateTutorRequest request, @PathVariable Long id)
      Updates an existing tutor by its unique identifier.
      Parameters:
      request - an object containing the updated tutor details
      id - the unique identifier of the tutor to update
      Returns:
      a ResponseEntity
    • deleteTutor

      @DeleteMapping("/{id}") @Secured({"SUPERUSER","ORG_ADMIN","CURATOR"}) public org.springframework.http.ResponseEntity<Void> deleteTutor(@PathVariable Long id)
      Deletes a tutor by its unique identifier.
      Parameters:
      id - the unique identifier of the tutor to delete
      Returns:
      a ResponseEntity