Class AdminController
java.lang.Object
callofproject.dev.project.controller.AdminController
This class represents a controller for administrative operations related to projects.
It handles HTTP requests for project administration and interacts with the AdminService.
-
Constructor Summary
ConstructorsConstructorDescriptionAdminController
(IAdminService adminService) Constructs a new AdminController with the provided AdminService dependency. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>
cancelProject
(UUID projectId) Handles the HTTP POST request to cancel a project.org.springframework.http.ResponseEntity<Object>
findAll
(int page) Handles the HTTP GET request to retrieve all projects.
-
Constructor Details
-
AdminController
Constructs a new AdminController with the provided AdminService dependency.- Parameters:
adminService
- The AdminService instance used for handling administrative operations.
-
-
Method Details
-
cancelProject
@PostMapping("/cancel") public org.springframework.http.ResponseEntity<Object> cancelProject(@RequestParam("pid") UUID projectId) Handles the HTTP POST request to cancel a project.- Parameters:
projectId
- The unique identifier (UUID) of the project to be canceled.- Returns:
- ResponseEntity with the result of the cancel operation, or an error message in case of failure.
-
findAll
@GetMapping("/all") public org.springframework.http.ResponseEntity<Object> findAll(@RequestParam("p") int page) Handles the HTTP GET request to retrieve all projects.- Parameters:
page
- The page number for paginated results.- Returns:
- ResponseEntity containing ProjectDTO if successful, or an error message if there's an issue.
-