package cn.freemud.demo.manager;

import cn.freemud.demo.entities.bo.goods.ProductBO;
import cn.freemud.service.impl.AssortmentSdkService;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Collections;
import java.util.List;

public class AssortmentSdkManager {

    @Autowired
    private AssortmentSdkService assortmentSdkService;

    /**
     *
     * @param partnerId 商户id
     * @param storeId 门店id
     * @param spuId2 spuid
     * @param menuType 业务类型,saas,delivery
     * @return
     */
    public ProductBO getProductsInfoSdk(String partnerId, String storeId, String spuId2, String menuType){
        // 获取添加商品的详细信息
        List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId, Collections.singletonList(spuId2), menuType, null);
        ProductBeanDTO productBeanDTO = productBeanListSpuClass.get(0);
        ProductBO productBO = convert2ProductBO(productBeanDTO);
        return productBO;

    }

    private ProductBO convert2ProductBO(ProductBeanDTO productBeanDTO) {
        return null;
    }


}
