Created
March 20, 2021 01:43
-
-
Save srdelarosa/7e3b40e57ec448cb5a0772c0a90e626e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.newhorizons.takeitnow.item.application.mainmodule.mapper; | |
import com.newhorizons.takeitnow.item.application.mainmodule.dto.ProductDto; | |
import com.newhorizons.takeitnow.item.domain.entity.Product; | |
import org.mapstruct.InheritInverseConfiguration; | |
import org.mapstruct.Mapper; | |
import org.mapstruct.Mapping; | |
import org.mapstruct.Mappings; | |
import java.util.List; | |
@Mapper(componentModel = "spring") | |
public interface IProductMapper { | |
@Mappings({ | |
@Mapping(source = "productId", target = "sku"), | |
@Mapping(source = "description", target = "name") | |
}) | |
ProductDto toProductDto(Product product); | |
List<ProductDto> toProductsDto(List<Product> products); | |
@InheritInverseConfiguration | |
Product toProduct(ProductDto productDto); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment