Class ProjectService
java.lang.Object
callofproject.dev.project.service.ProjectService
- All Implemented Interfaces:
IProjectService
@Service("callofproject.dev.project.service")
@Lazy
public class ProjectService
extends Object
implements IProjectService
Service class for managing projects.
It implements the IProjectService interface.
-
Constructor Summary
ConstructorsConstructorDescriptionProjectService(callofproject.dev.data.project.dal.ProjectServiceHelper serviceHelper, callofproject.dev.nosql.dal.ProjectTagServiceHelper projectTagServiceHelper, callofproject.dev.nosql.dal.TagServiceHelper tagServiceHelper, KafkaProducer kafkaProducer, com.fasterxml.jackson.databind.ObjectMapper objectMapper, IProjectMapper projectMapper, S3Service s3Service, IProjectParticipantMapper projectParticipantMapper, callofproject.dev.nosql.repository.IProjectTagRepository projectTagRepository) Constructor for ProjectService. -
Method Summary
Modifier and TypeMethodDescriptioncallofproject.dev.data.common.clas.ResponseMessage<Object>addProjectJoinRequest(UUID projectId, UUID userId) Adds a request to join a project.callofproject.dev.data.common.clas.ResponseMessage<Object>addProjectJoinRequestCallback(UUID projectId, UUID userId) Callback for adding a request to join a project.callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object>findAllOwnerProjectsByUserId(UUID userId, int page) Retrieves all projects owned by a user, with pagination.callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object>findAllOwnerProjectsByUsername(String username, int page) Retrieves all projects owned by a user, identified by username, with pagination.callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object>findAllParticipantProjectByUserId(UUID userId, int page) Retrieves all projects a user is participating in, with pagination.callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object>findAllProjectDiscoveryView(int page) Retrieves a paginated list of projects for discovery purposes.callofproject.dev.data.common.clas.ResponseMessage<Object>findProjectDetail(UUID projectId) Retrieves detailed information of a specific project.callofproject.dev.data.common.clas.ResponseMessage<Object>findProjectDetailIfHasPermission(UUID projectId, UUID userId) Retrieves detailed information of a specific project if the user has permission.callofproject.dev.data.common.clas.ResponseMessage<Object>findProjectOverview(UUID projectId) Retrieves an overview of a specific project.callofproject.dev.data.common.clas.ResponseMessage<Object>findProjectOwnerView(UUID userId, UUID projectId) Retrieves a view of a project from the perspective of its owner.callofproject.dev.data.common.clas.ResponseMessage<Object>saveProject(ProjectSaveDTO projectDTO) Saves a new project using a ProjectSaveDTO.callofproject.dev.data.common.clas.ResponseMessage<Object>saveProjectV2(ProjectSaveDTO saveDTO, org.springframework.web.multipart.MultipartFile file) Saves a new project with an additional file using ProjectSaveDTO and MultipartFile.callofproject.dev.data.common.clas.ResponseMessage<Object>updateProject(ProjectUpdateDTO projectDTO) Updates a project using ProjectUpdateDTO.callofproject.dev.data.common.clas.ResponseMessage<Object>updateProjectV2(ProjectUpdateDTO projectDTO, org.springframework.web.multipart.MultipartFile file) Updates a project with an additional file using ProjectUpdateDTO and MultipartFile.
-
Constructor Details
-
ProjectService
public ProjectService(@Qualifier("callofproject.dev.data.project.dal.ProjectServiceHelper") callofproject.dev.data.project.dal.ProjectServiceHelper serviceHelper, @Qualifier("callofproject.dev.nosql.dal.ProjectTagServiceHelper") callofproject.dev.nosql.dal.ProjectTagServiceHelper projectTagServiceHelper, @Qualifier("callofproject.dev.nosql.dal.TagServiceHelper") callofproject.dev.nosql.dal.TagServiceHelper tagServiceHelper, KafkaProducer kafkaProducer, com.fasterxml.jackson.databind.ObjectMapper objectMapper, IProjectMapper projectMapper, S3Service s3Service, IProjectParticipantMapper projectParticipantMapper, callofproject.dev.nosql.repository.IProjectTagRepository projectTagRepository) Constructor for ProjectService.- Parameters:
serviceHelper- The ProjectServiceHelper to be used for data access.projectTagServiceHelper- The ProjectTagServiceHelper to be used for data access.tagServiceHelper- The TagServiceHelper to be used for data access.kafkaProducer- The KafkaProducer to be used for sending notifications.objectMapper- The ObjectMapper to be used for converting objects to JSON.projectMapper- The IProjectMapper to be used for mapping Project entities to DTOs.s3Service- The S3Service to be used for uploading files to S3.projectParticipantMapper- The IProjectParticipantMapper to be used for mapping ProjectParticipant entities to DTOs.projectTagRepository- The IProjectTagRepository to be used for data access.
-
-
Method Details
-
saveProject
public callofproject.dev.data.common.clas.ResponseMessage<Object> saveProject(ProjectSaveDTO projectDTO) Saves a new project using a ProjectSaveDTO.- Specified by:
saveProjectin interfaceIProjectService- Parameters:
projectDTO- Data Transfer Object containing project information.- Returns:
- A ResponseMessage containing the result of the save operation.
-
saveProjectV2
public callofproject.dev.data.common.clas.ResponseMessage<Object> saveProjectV2(ProjectSaveDTO saveDTO, org.springframework.web.multipart.MultipartFile file) Saves a new project with an additional file using ProjectSaveDTO and MultipartFile.- Specified by:
saveProjectV2in interfaceIProjectService- Parameters:
saveDTO- Data Transfer Object containing project information.file- The file to be associated with the project.- Returns:
- A ResponseMessage containing the result of the save operation.
-
findAllParticipantProjectByUserId
public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> findAllParticipantProjectByUserId(UUID userId, int page) Retrieves all projects a user is participating in, with pagination.- Specified by:
findAllParticipantProjectByUserIdin interfaceIProjectService- Parameters:
userId- The UUID of the user.page- The page number for pagination.- Returns:
- A MultipleResponseMessagePageable containing a list of projects.
-
updateProject
public callofproject.dev.data.common.clas.ResponseMessage<Object> updateProject(ProjectUpdateDTO projectDTO) Updates a project using ProjectUpdateDTO.- Specified by:
updateProjectin interfaceIProjectService- Parameters:
projectDTO- Data Transfer Object containing updated project information.- Returns:
- A ResponseMessage containing the result of the update operation.
-
updateProjectV2
public callofproject.dev.data.common.clas.ResponseMessage<Object> updateProjectV2(ProjectUpdateDTO projectDTO, org.springframework.web.multipart.MultipartFile file) Updates a project with an additional file using ProjectUpdateDTO and MultipartFile.- Specified by:
updateProjectV2in interfaceIProjectService- Parameters:
projectDTO- Data Transfer Object containing updated project information.file- The file to be associated with the project update.- Returns:
- A ResponseMessage containing the result of the update operation.
-
findAllOwnerProjectsByUserId
public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> findAllOwnerProjectsByUserId(UUID userId, int page) Retrieves all projects owned by a user, with pagination.- Specified by:
findAllOwnerProjectsByUserIdin interfaceIProjectService- Parameters:
userId- The UUID of the user.page- The page number for pagination.- Returns:
- A MultipleResponseMessagePageable containing a list of owned projects.
-
findAllOwnerProjectsByUsername
public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> findAllOwnerProjectsByUsername(String username, int page) Retrieves all projects owned by a user, identified by username, with pagination.- Specified by:
findAllOwnerProjectsByUsernamein interfaceIProjectService- Parameters:
username- The username of the project owner.page- The page number for pagination.- Returns:
- A MultipleResponseMessagePageable containing a list of owned projects.
-
findProjectOwnerView
public callofproject.dev.data.common.clas.ResponseMessage<Object> findProjectOwnerView(UUID userId, UUID projectId) Retrieves a view of a project from the perspective of its owner.- Specified by:
findProjectOwnerViewin interfaceIProjectService- Parameters:
userId- The UUID of the owner.projectId- The UUID of the project.- Returns:
- A ResponseMessage containing the ProjectOwnerView.
-
findAllProjectDiscoveryView
public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> findAllProjectDiscoveryView(int page) Retrieves a paginated list of projects for discovery purposes.- Specified by:
findAllProjectDiscoveryViewin interfaceIProjectService- Parameters:
page- The page number for pagination.- Returns:
- A MultipleResponseMessagePageable containing a list of project discovery views.
-
findProjectOverview
public callofproject.dev.data.common.clas.ResponseMessage<Object> findProjectOverview(UUID projectId) Retrieves an overview of a specific project.- Specified by:
findProjectOverviewin interfaceIProjectService- Parameters:
projectId- The UUID of the project.- Returns:
- A ResponseMessage containing the ProjectOverview.
-
addProjectJoinRequest
public callofproject.dev.data.common.clas.ResponseMessage<Object> addProjectJoinRequest(UUID projectId, UUID userId) Adds a request to join a project.- Specified by:
addProjectJoinRequestin interfaceIProjectService- Parameters:
projectId- The UUID of the project to join.userId- The UUID of the user requesting to join.- Returns:
- A ResponseMessage containing the result of the join request.
-
findProjectDetail
Retrieves detailed information of a specific project.- Specified by:
findProjectDetailin interfaceIProjectService- Parameters:
projectId- The UUID of the project.- Returns:
- A ResponseMessage containing the ProjectDetail.
-
findProjectDetailIfHasPermission
public callofproject.dev.data.common.clas.ResponseMessage<Object> findProjectDetailIfHasPermission(UUID projectId, UUID userId) Retrieves detailed information of a specific project if the user has permission.- Specified by:
findProjectDetailIfHasPermissionin interfaceIProjectService- Parameters:
projectId- The UUID of the project.userId- The UUID of the user.- Returns:
- A ResponseMessage containing the ProjectDetail.
-
addProjectJoinRequestCallback
public callofproject.dev.data.common.clas.ResponseMessage<Object> addProjectJoinRequestCallback(UUID projectId, UUID userId) Callback for adding a request to join a project.- Specified by:
addProjectJoinRequestCallbackin interfaceIProjectService- Parameters:
projectId- The UUID of the project to join.userId- The UUID of the user requesting to join.- Returns:
- A ResponseMessage containing the result of the join request callback.
-