Search in sources :

Example 1 with UploadFilesDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.UploadFilesDTO in project ArachneCentralAPI by OHDSI.

the class BaseAnalysisController method uploadFile.

@ApiOperation("Upload file to attach to analysis.")
@RequestMapping(value = "/api/v1/analysis-management/analyses/{analysisId}/upload", method = POST)
public JsonResult<List<AnalysisFileDTO>> uploadFile(Principal principal, @Valid UploadFilesDTO uploadFilesLinks, @PathVariable("analysisId") Long id) throws PermissionDeniedException, NotExistException, IOException {
    IUser user = getUser(principal);
    T analysis = analysisService.getById(id);
    List<UploadFileDTO> files = Stream.concat(uploadFilesLinks.getFiles().stream(), uploadFilesLinks.getLinks().stream()).collect(Collectors.toList());
    return saveFiles(files, user, analysis);
}
Also used : UploadFileDTO(com.odysseusinc.arachne.portal.api.v1.dto.UploadFileDTO) PUT(org.springframework.web.bind.annotation.RequestMethod.PUT) GET(org.springframework.web.bind.annotation.RequestMethod.GET) POST(org.springframework.web.bind.annotation.RequestMethod.POST) IUser(com.odysseusinc.arachne.portal.model.IUser) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

UploadFileDTO (com.odysseusinc.arachne.portal.api.v1.dto.UploadFileDTO)1 IUser (com.odysseusinc.arachne.portal.model.IUser)1 ApiOperation (io.swagger.annotations.ApiOperation)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 GET (org.springframework.web.bind.annotation.RequestMethod.GET)1 POST (org.springframework.web.bind.annotation.RequestMethod.POST)1 PUT (org.springframework.web.bind.annotation.RequestMethod.PUT)1