Class FacialValidationController
java.lang.Object
com.markvarga21.studentmanager.controller.FacialValidationController
@RestController
@RequestMapping("/api/v1/facialValidations")
@CrossOrigin
public class FacialValidationController
extends Object
A controller which is used to make facial validations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String>
deleteFacialValidationDataByPassportNumber
(String passportNumber) Deletes a facial validation data with the given passport number.org.springframework.data.domain.Page<FacialValidationData>
getAllFacialValidationData
(Integer page, Integer size) Retrieves all the facial validation data.org.springframework.http.ResponseEntity<FacialValidationData>
getFacialValidationDataByPassportNumber
(String passportNumber) Retrieves the facial validation data for the given passport number.org.springframework.http.ResponseEntity<String>
setFacialValidationDataToValid
(String passportNumber) Sets the facial validation data to valid.
-
Constructor Details
-
FacialValidationController
public FacialValidationController()
-
-
Method Details
-
getAllFacialValidationData
@GetMapping @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.data.domain.Page<FacialValidationData> getAllFacialValidationData(@RequestParam(defaultValue="0") Integer page, @RequestParam(defaultValue="10") Integer size) Retrieves all the facial validation data.- Parameters:
page
- The page number.size
- The number of elements inside a single page.- Returns:
- A page storing facial validations.
-
getFacialValidationDataByPassportNumber
@GetMapping("/{passportNumber}") @PreAuthorize("hasRole(\'ROLE_USER\')") public org.springframework.http.ResponseEntity<FacialValidationData> getFacialValidationDataByPassportNumber(@PathVariable String passportNumber) Retrieves the facial validation data for the given passport number.- Parameters:
passportNumber
- The passport number of the student.- Returns:
- The facial validation data.
-
deleteFacialValidationDataByPassportNumber
@DeleteMapping("/{passportNumber}") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<String> deleteFacialValidationDataByPassportNumber(@PathVariable String passportNumber) Deletes a facial validation data with the given passport number.- Parameters:
passportNumber
- The passport number of the student.- Returns:
- A message which indicates whether the deletion was successful or not.
-
setFacialValidationDataToValid
@PostMapping("/setFacialValidationDataToValid") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<String> setFacialValidationDataToValid(@RequestParam String passportNumber) Sets the facial validation data to valid.- Parameters:
passportNumber
- The passport number of the student.- Returns:
- A message which indicates whether the operation was successful or not.
-