use of org.eclipse.smarthome.automation.dto.RuleTemplateDTO in project smarthome by eclipse.
the class TemplateResource method getAll.
@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get all available templates.", response = Template.class, responseContainer = "Collection")
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = Template.class, responseContainer = "Collection") })
public Response getAll(@HeaderParam("Accept-Language") @ApiParam(value = "language") String language) {
Locale locale = LocaleUtil.getLocale(language);
Collection<RuleTemplateDTO> result = templateRegistry.getAll(locale).stream().map(template -> RuleTemplateDTOMapper.map(template)).collect(Collectors.toList());
return Response.ok(result).build();
}
Aggregations