java.lang.Object
com.mirna.hospitalmanagementapi.application.controllers.DoctorController

@RestController @RequestMapping("/api/v1.0/doctors") public class DoctorController extends Object
A Spring REST controller for managing doctors.
Version:
1.0
Author:
Mirna Gama
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<Object>
    getDoctors(org.springframework.data.domain.Pageable pageable)
    Get method to receive a paginated sublist of objects containing data transfer objects with Doctor public information
    org.springframework.http.ResponseEntity<Object>
    postDoctor(@Valid DoctorDTO doctorDTO)
    Post method to create a new Doctor object based on the provided DTO.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DoctorController

      public DoctorController()
  • Method Details

    • postDoctor

      @PostMapping public org.springframework.http.ResponseEntity<Object> postDoctor(@RequestBody @Valid @Valid DoctorDTO doctorDTO)
      Post method to create a new Doctor object based on the provided DTO.
      Parameters:
      doctorDTO - The data transfer object containing data for Doctor entity.
      Returns:
      A response entity containing the saved doctor if successful, or a 400-level error if there is a validation error
    • getDoctors

      @GetMapping public org.springframework.http.ResponseEntity<Object> getDoctors(@PageableDefault(size=10,sort="name") org.springframework.data.domain.Pageable pageable)
      Get method to receive a paginated sublist of objects containing data transfer objects with Doctor public information
      Parameters:
      pageable - Pagination information, such as size and page number
      Returns:
      A response entity containing the paginated sublist of doctors if successful