use of com.odysseusinc.arachne.portal.api.v1.dto.CommentTopicDTO in project ArachneCentralAPI by OHDSI.
the class CommentController method get.
@ApiOperation(value = "Get topic with all comments")
@RequestMapping(value = "/api/v1/comments/{topicId}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
public JsonResult<CommentTopicDTO> get(@PathVariable("topicId") Long topicId) throws NotExistException {
final CommentTopic topic = commentService.getTopic(topicId);
JsonResult<CommentTopicDTO> result = new JsonResult<>(NO_ERROR);
result.setResult(conversionService.convert(topic, CommentTopicDTO.class));
return result;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.CommentTopicDTO in project ArachneCentralAPI by OHDSI.
the class CommentTopicToCommentTopicDTOConverter method convert.
@Override
public CommentTopicDTO convert(CommentTopic source) {
final CommentTopicDTO commentTopicDTO = new CommentTopicDTO();
final List<CommentDTO> commentDTOS = source.getComments().stream().map(c -> conversionService.convert(c, CommentDTO.class)).collect(Collectors.toList());
commentTopicDTO.setId(source.getId());
commentTopicDTO.setComments(commentDTOS);
return commentTopicDTO;
}
Aggregations