class EcoNewsController {

    @ApiOperation(value = "Get eco news by tags")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = HttpStatuses.OK),
            @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST),
            @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN),
    })
    @GetMapping("/tags")
    @ApiPageable
    public ResponseEntity<PageableDto<EcoNewsDto>> getEcoNews(
            @ApiIgnore Pageable page,
            @ApiParam(value = "Tags to filter (if do not input tags get all)")
            @RequestParam(required = false) List<String> tags
    ) {
        if (tags == null || tags.isEmpty()) {
            return ResponseEntity.status(HttpStatus.OK).body(
                    ecoNewsService.findAll(page));
        }
        return ResponseEntity.status(HttpStatus.OK).body(ecoNewsService.find(page, tags));
    }

}