use of com.odysseusinc.arachne.portal.api.v1.dto.UserInfoDTO in project ArachneCentralAPI by OHDSI.
the class ArachneFileMetaToFileDTOConverter method convert.
@Override
public FileDTO convert(ArachneFileMeta source) {
FileDTO fileDTO = new FileDTO();
fileDTO.setUuid(source.getUuid());
fileDTO.setPath(source.getPath());
fileDTO.setName(source.getName());
fileDTO.setCreated(source.getCreated());
fileDTO.setUpdated(source.getUpdated());
fileDTO.setDocType(source.getContentType());
fileDTO.setAuthor(new UserInfoDTO(UserIdUtils.idToUuid(source.getCreatedBy())));
return fileDTO;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.UserInfoDTO in project ArachneCentralAPI by OHDSI.
the class PaperFileToPaperFileDTOConverter method convert.
@Override
public PaperFileDTO convert(AbstractPaperFile paperFile) {
final PaperFileDTO paperFileDTO = new PaperFileDTO();
paperFileDTO.setUuid(paperFile.getUuid());
paperFileDTO.setName(paperFile.getRealName());
paperFileDTO.setLabel(paperFile.getLabel());
paperFileDTO.setCreated(paperFile.getCreated());
paperFileDTO.setUpdated(paperFile.getUpdated());
paperFileDTO.setDocType(paperFile.getContentType());
final UserInfoDTO authorDTO = conversionService.convert(paperFile.getAuthor(), UserInfoDTO.class);
paperFileDTO.setAuthor(authorDTO);
paperFileDTO.setLink(paperFile.getLink());
paperFileDTO.setAntivirusStatus(paperFile.getAntivirusStatus());
paperFileDTO.setAntivirusDescription(paperFile.getAntivirusDescription());
paperFileDTO.setInsightId(paperFile.getPaper().getId());
return paperFileDTO;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.UserInfoDTO in project ArachneCentralAPI by OHDSI.
the class BaseAuthenticationController method info.
@ApiOperation("Get information about current user.")
@RequestMapping(value = "/api/v1/auth/me", method = RequestMethod.GET)
public JsonResult<UserInfoDTO> info(Principal principal) {
final JsonResult<UserInfoDTO> result;
IUser user = userService.getByEmailInAnyTenant(principal.getName());
final UserInfoDTO userInfo = conversionService.convert(user, UserInfoDTO.class);
result = new JsonResult<>(JsonResult.ErrorCode.NO_ERROR);
result.setResult(userInfo);
return result;
}
Aggregations