class EcoNewsServiceImpl implements EcoNewsService {

    @Override
    public PageableDto<EcoNewsDto> findAll(Pageable page) {
        Page<EcoNews> pages = ecoNewsRepo.findAllByOrderByCreationDateDesc(page);
        List<EcoNewsDto> ecoNewsDtos = pages
                .stream()
                .map(ecoNews -> modelMapper.map(ecoNews, EcoNewsDto.class))
                .collect(Collectors.toList());

        return new PageableDto<>(
            ecoNewsDtos,
            pages.getTotalElements(),
            pages.getPageable().getPageNumber(),
            pages.getTotalPages()
        );
    }

}