| | |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Pageable; |
| | |
| | | searchResult.setTotal(pageResult.getTotalElements()); |
| | | searchResult.setPages(pageResult.getTotalPages()); |
| | | if (!CollectionUtils.isEmpty(pageResult.getContent())){ |
| | | List<FindGasCategoryPageRespDTO> respDTOS = new ArrayList<>(); |
| | | BeanUtils.copyProperties(pageResult.getContent(),respDTOS); |
| | | List<FindGasCategoryPageRespDTO> respDTOS = pageResult.getContent().stream().map(gasCategory -> { |
| | | FindGasCategoryPageRespDTO dto = new FindGasCategoryPageRespDTO(); |
| | | BeanUtils.copyProperties(gasCategory,dto); |
| | | return dto; |
| | | }).collect(Collectors.toList()); |
| | | searchResult.setData(respDTOS); |
| | | } |
| | | return searchResult; |