Example #1
0
 @Override
 public List<ProductPromoteDto> getPromoteProduct() {
   List<ProductPromoteDto> dtos = new ArrayList<>();
   List<ProductPromote> promotes = promoteRepository.findAll();
   if (promotes != null) {
     Product product;
     for (ProductPromote promote : promotes) {
       product =
           productRepository.findByProductIdAndStatus(
               promote.getProductId(), BaseStatus.EFFECT.getKey());
       // Assert.notNull(product);
       if (product != null) {
         ProductPromoteDto dto = ConverterService.convert(promote, ProductPromoteDto.class);
         dto.setProductDto(ConverterService.convert(product, ProductDto.class));
         dtos.add(dto);
       }
     }
   }
   return dtos;
 }
Example #2
0
 @Override
 public List<BasicParaDto> getCarouselPictures() {
   List<BasicParaDto> dtos = new ArrayList<>();
   List<BasicPara> paras = paraRepository.findByTypeId(BasicTypeConstant.USER_LIFE_CAROUSEL);
   if (paras != null) {
     BasicParaDto dto;
     for (BasicPara para : paras) {
       dto = ConverterService.convert(para, BasicParaDto.class);
       dtos.add(dto);
     }
   }
   return dtos;
 }