Class DoctorController
java.lang.Object
com.mirna.hospitalmanagementapi.application.controllers.DoctorController
A Spring REST controller for managing doctors.
- Version:
- 1.0
- Author:
- Mirna Gama
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.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 informationorg.springframework.http.ResponseEntity<Object>postDoctor(@Valid DoctorDTO doctorDTO) Post method to create a new Doctor object based on the provided DTO.
-
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
-