Class ProjectOwnerController

java.lang.Object
callofproject.dev.project.controller.ProjectOwnerController

@RestController @RequestMapping("api/project/project-owner") public class ProjectOwnerController extends Object
This class represents a controller for managing project owner-related operations. It handles HTTP requests related to project owners and interacts with the ProjectOwnerService.
  • Constructor Details

    • ProjectOwnerController

      public ProjectOwnerController(IProjectOwnerService projectOwnerService)
      Constructs a new ProjectOwnerController with the provided dependencies.
      Parameters:
      projectOwnerService - The IProjectOwnerService instance used for handling project owner-related operations.
  • Method Details

    • finishProject

      @PostMapping("finish") public org.springframework.http.ResponseEntity<Object> finishProject(@RequestParam("uid") UUID userId, @RequestParam("pid") UUID projectId)
      Handles the HTTP POST request to set the project status to "finish."
      Parameters:
      userId - The unique identifier (UUID) of the user initiating the action.
      projectId - The unique identifier (UUID) of the project to be marked as finished.
      Returns:
      ResponseEntity with the result of the operation as ProjectDetailDTO if successful, or an error message in case of failure.
    • changeProjectStatus

      @PostMapping("change/status") public org.springframework.http.ResponseEntity<Object> changeProjectStatus(@RequestParam("uid") UUID userId, @RequestParam("pid") UUID projectId, @RequestParam("status") callofproject.dev.data.project.entity.enums.EProjectStatus status)
      Handles the HTTP POST request to change the project status.
      Parameters:
      userId - The unique identifier (UUID) of the user initiating the action.
      projectId - The unique identifier (UUID) of the project to change the status of.
      status - The new project status.
      Returns:
      ResponseEntity with the result of the operation as ProjectDetailDTO if successful, or an error message in case of failure.
    • removeProject

      @DeleteMapping("remove") public org.springframework.http.ResponseEntity<Object> removeProject(@RequestParam("uid") UUID userId, @RequestParam("pid") UUID projectId)
      Handles the HTTP DELETE request to remove a project.
      Parameters:
      userId - The unique identifier (UUID) of the user initiating the action.
      projectId - The unique identifier (UUID) of the project to be removed.
      Returns:
      ResponseEntity with the result of the operation as ProjectDetailDTO if successful, or an error message in case of failure.
    • removeParticipant

      @DeleteMapping("participant/remove") public org.springframework.http.ResponseEntity<Object> removeParticipant(@RequestParam("pid") UUID projectId, @RequestParam("uid") UUID userId)
      Handles the HTTP DELETE request to remove a participant from a project.
      Parameters:
      projectId - The unique identifier (UUID) of the project from which the participant is to be removed.
      userId - The unique identifier (UUID) of the participant to be removed.
      Returns:
      ResponseEntity with the result of the operation as ProjectDetailDTO if successful, or an error message in case of failure.
    • addParticipant

      @PostMapping("participant/add") public org.springframework.http.ResponseEntity<Object> addParticipant(@RequestBody SaveProjectParticipantDTO dto)
      Handles the HTTP POST request to add a participant to a project.
      Parameters:
      dto - The SaveProjectParticipantDTO containing details of the participant to be added.
      Returns:
      ResponseEntity with the result of the operation as ProjectDTO if successful, or an error message in case of failure.
    • approveProjectParticipantRequest

      @PostMapping("/participant/request/approve") public org.springframework.http.ResponseEntity<Object> approveProjectParticipantRequest(@RequestBody ParticipantRequestDTO dto)
      Handles the HTTP POST request to approve or reject a project participant request.
      Parameters:
      dto - The ParticipantRequestDTO containing details of the request to be approved or rejected.
      Returns:
      ResponseEntity with the result of the operation as ProjectDTO if successful, or an error message in case of failure.