use of com.odysseusinc.arachne.commons.api.v1.dto.CommonDataNodeDTO in project ArachneCentralAPI by OHDSI.
the class BaseDataNodeController method updateDataNode.
@ApiOperation("Update data node info")
@RequestMapping(value = "/api/v1/data-nodes/{dataNodeId}", method = RequestMethod.PUT)
public JsonResult<CommonDataNodeDTO> updateDataNode(@PathVariable("dataNodeId") Long dataNodeId, @RequestBody @Valid CommonDataNodeRegisterDTO commonDataNodeRegisterDTO, Principal principal) throws PermissionDeniedException, NotExistException {
final IUser user = getUser(principal);
final DN dataNode = conversionService.convert(commonDataNodeRegisterDTO, getDataNodeDNClass());
dataNode.setId(dataNodeId);
final DN updatedDataNode = baseDataNodeService.update(dataNode);
final CommonDataNodeDTO dataNodeRegisterResponseDTO = conversionService.convert(updatedDataNode, CommonDataNodeDTO.class);
final JsonResult<CommonDataNodeDTO> result = new JsonResult<>(JsonResult.ErrorCode.NO_ERROR);
result.setResult(dataNodeRegisterResponseDTO);
return result;
}
use of com.odysseusinc.arachne.commons.api.v1.dto.CommonDataNodeDTO in project ArachneCentralAPI by OHDSI.
the class DataNodeToCommonDataNodeDTOConverter method convert.
@Override
public CommonDataNodeDTO convert(DataNode source) {
CommonDataNodeDTO dto = new CommonDataNodeDTO();
dto.setDataNodeUuid(source.getSid());
dto.setName(source.getName());
dto.setDescription(source.getDescription());
dto.setToken(source.getToken());
dto.setCentralId(source.getId());
return dto;
}
Aggregations