package co.yixiang.yshop.module.product.convert.storeproductattrvalue;

import co.yixiang.yshop.module.product.controller.admin.storeproduct.vo.CampaignSkuRespVO;
import co.yixiang.yshop.module.product.dal.dataobject.storeproductattrvalue.StoreProductAttrValueDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 商品属性值 Convert
 *
 * @author yshop
 */
@Mapper
public interface StoreProductAttrValueConvert {

    StoreProductAttrValueConvert INSTANCE = Mappers.getMapper(StoreProductAttrValueConvert.class);

    @Mapping(target = "skuId", source = "id")
    List<CampaignSkuRespVO> convertList(List<StoreProductAttrValueDO> list);

    @Mapping(source = "id", target = "skuId")
    CampaignSkuRespVO convert(StoreProductAttrValueDO valueDO);
}
