Search in sources :

Example 1 with CreateProjectDTO

use of org.c4sg.dto.CreateProjectDTO in project c4sg-services by Code4SocialGood.

the class ProjectController method createProject.

@CrossOrigin
@RequestMapping(method = RequestMethod.POST)
@ApiOperation(value = "Add a new project")
public Map<String, Object> createProject(@ApiParam(value = "Project object to return", required = true) @RequestBody @Valid CreateProjectDTO createProjectDTO) {
    System.out.println("************** Add **************");
    Map<String, Object> responseData = null;
    try {
        ProjectDTO createProject = projectService.createProject(createProjectDTO);
        responseData = Collections.synchronizedMap(new HashMap<>());
        responseData.put("project", createProject);
    } catch (Exception e) {
        System.out.println(e);
    }
    return responseData;
}
Also used : ProjectDTO(org.c4sg.dto.ProjectDTO) CreateProjectDTO(org.c4sg.dto.CreateProjectDTO) HashMap(java.util.HashMap) NotFoundException(org.c4sg.exception.NotFoundException) UserProjectException(org.c4sg.exception.UserProjectException) ProjectServiceException(org.c4sg.exception.ProjectServiceException) IOException(java.io.IOException) BadRequestException(org.c4sg.exception.BadRequestException)

Aggregations

IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 CreateProjectDTO (org.c4sg.dto.CreateProjectDTO)1 ProjectDTO (org.c4sg.dto.ProjectDTO)1 BadRequestException (org.c4sg.exception.BadRequestException)1 NotFoundException (org.c4sg.exception.NotFoundException)1 ProjectServiceException (org.c4sg.exception.ProjectServiceException)1 UserProjectException (org.c4sg.exception.UserProjectException)1