use of com.ncedu.fooddelivery.api.v1.dto.product.ProductUpdateDTO in project 2021-msk-food-delivery by netcracker-edu.
the class ProductServiceImpl method updateProduct.
@Override
public void updateProduct(Long id, ProductUpdateDTO updatedProduct) {
Product product = getProductById(id);
productMapper.updateToEntity(product, updatedProduct);
productRepo.save(product);
}
use of com.ncedu.fooddelivery.api.v1.dto.product.ProductUpdateDTO in project 2021-msk-food-delivery by netcracker-edu.
the class ProductUtils method createProductUpdateDTO.
public static ProductUpdateDTO createProductUpdateDTO(Product p) {
ProductUpdateDTO productDTO = new ProductUpdateDTO();
productDTO.setDescription(p.getDescription());
productDTO.setPrice(p.getPrice());
productDTO.setName(p.getName());
productDTO.setWeight(p.getWeight());
productDTO.setExpirationDays(p.getExpirationDays());
return productDTO;
}
Aggregations