Package com.myhrcrmproject.controller
Class InterviewController
java.lang.Object
com.myhrcrmproject.controller.InterviewController
Controller class for managing interview-related operations in the HR CRM system.
This class defines RESTful APIs for various interview actions, including retrieving all interviews, finding interviews by ID, creating new interviews, updating existing interviews, and deleting interviews.
Additionally, it provides endpoints to retrieve interviews based on different criteria such as status ID, employee ID, date, etc.
- Version:
- 1.0
- Author:
- Denys Chaykovskyy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<InterviewResponseDTO>createNew(InterviewRequestDTO requestDTO) Endpoint to create a new interview.voidEndpoint to delete a interview.org.springframework.http.ResponseEntity<List<InterviewResponseDTO>>findAll()Endpoint to retrieve a list of all interviews.org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>>findAllByDate(InterviewDateRequestDTO requestDTO) Retrieves a list of interviews by date.org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>>Endpoint to retrieve a list of interviews by employee ID.org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>>findAllByEmployeeId(Integer id, InterviewDateRequestDTO requestDTO) Retrieves a list of interviews by date and employee ID.org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>>findAllByStatusId(Integer statusId) Retrieves a list of interviews by status ID.org.springframework.http.ResponseEntity<InterviewResponseDTO>Endpoint to retrieve a interview by its ID.org.springframework.http.ResponseEntity<InterviewResponseDTO>update(Integer id, InterviewRequestDTO requestDTO) Endpoint to update an existing interview.
-
Constructor Details
-
InterviewController
public InterviewController()
-
-
Method Details
-
findAll
Endpoint to retrieve a list of all interviews.- Returns:
- A
ResponseEntitywith a list ofInterviewResponseDTOrepresenting all interviews.
-
findById
@GetMapping("/{id}") public org.springframework.http.ResponseEntity<InterviewResponseDTO> findById(@PathVariable("id") Integer id) Endpoint to retrieve a interview by its ID.- Parameters:
id- The ID of the interview to retrieve.- Returns:
- A
ResponseEntitywith theInterviewResponseDTOrepresenting the retrieved interview.
-
createNew
@PostMapping public org.springframework.http.ResponseEntity<InterviewResponseDTO> createNew(@RequestBody InterviewRequestDTO requestDTO) Endpoint to create a new interview.- Parameters:
requestDTO- The request body containing interview details.- Returns:
- A
ResponseEntitywith theInterviewResponseDTOrepresenting the newly created interview.
-
update
@PutMapping("/{id}") public org.springframework.http.ResponseEntity<InterviewResponseDTO> update(@PathVariable("id") Integer id, @RequestBody InterviewRequestDTO requestDTO) Endpoint to update an existing interview.- Parameters:
id- The ID of the interview to update.requestDTO- The request body containing updated interview details.- Returns:
- A
ResponseEntitywith theInterviewResponseDTOrepresenting the updated interview.
-
deleteCandidate
@DeleteMapping("/{id}") @ResponseStatus(NO_CONTENT) public void deleteCandidate(@PathVariable("id") Integer id) Endpoint to delete a interview.- Parameters:
id- The ID of the interview to delete.
-
findAllByStatusId
@GetMapping("/findAllByStatus/{id}") public org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>> findAllByStatusId(@PathVariable("id") Integer statusId) Retrieves a list of interviews by status ID.- Parameters:
statusId- The ID of the status.- Returns:
- A
ResponseEntitywith the list of interviews and HTTP status code 200 (OK).
-
findAllByEmployeeId
@GetMapping("/findAllByEmployee/{id}") public org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>> findAllByEmployeeId(@PathVariable("id") Integer id) Endpoint to retrieve a list of interviews by employee ID.- Parameters:
id- The ID of the employee.- Returns:
- A
ResponseEntitywith a list ofInterviewResponseDTOrepresenting interviews by employee ID.
-
findAllByEmployeeId
@PutMapping("/findAllByDateAndEmployee/{id}") public org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>> findAllByEmployeeId(@PathVariable("id") Integer id, @RequestBody InterviewDateRequestDTO requestDTO) Retrieves a list of interviews by date and employee ID.- Parameters:
id- The ID of the employee.requestDTO- The request body containing the date.- Returns:
- A
ResponseEntitywith the list of interviews and HTTP status code 200 (OK).
-
findAllByDate
@PutMapping("/findAllByDate") public org.springframework.http.ResponseEntity<List<InterviewShortResponseDTO>> findAllByDate(@RequestBody InterviewDateRequestDTO requestDTO) Retrieves a list of interviews by date.- Parameters:
requestDTO- The request body containing the date.- Returns:
- A
ResponseEntitywith the list of interviews and HTTP status code 200 (OK).
-