
package com.tmerclub.cloud.product.feign;

import com.tmerclub.cloud.api.product.feign.SkuComboFeignClient;
import com.tmerclub.cloud.common.order.vo.ShopCartItemVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.product.service.SkuComboService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

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

/**
 * @author tmerclub
 * @date 2020/12/8
 */
@DubboService
public class SkuComboFeignController implements SkuComboFeignClient {

    @Autowired
    private SkuComboService skuComboService;

    @Override
    public ServerResponseEntity<List<ShopCartItemVO>> getCombSpusBySkuId(Long skuId) {
        return ServerResponseEntity.success(skuComboService.getCombShopItemsAndBySkuIds(Collections.singletonList(skuId)));
    }
}
