| | |
| | | PageResult<ProductCustomerView> viewPageResult = new PageResult<>( |
| | | productList.stream().map(i -> { |
| | | ProductCustomerView view = new ProductCustomerView(); |
| | | BeanUtils.copyProperties(i, view); |
| | | BeanUtil.copyProperties(i, view); |
| | | return view; |
| | | }).collect(Collectors.toList()), |
| | | productPageResult.getTotalElements()); |
| | |
| | | public ResponseEntity<?> getProductDetails(@PathVariable Long productId) { |
| | | Product product = productService.getById(productId); |
| | | ProductCustomerView customerView = new ProductCustomerView(); |
| | | BeanUtil.copyProperties(product, customerView); |
| | | if (ObjUtil.isNotEmpty(product)) { |
| | | customerView.setImages(productImageService.queryImagesByProductId(productId).stream().map(i -> { |
| | | ProductImageCustomerView imageCustomerView = new ProductImageCustomerView(); |