
package com.tmerclub.cloud.product.service.impl;

import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.util.PageUtil;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.common.i18n.I18nMessage;
import com.tmerclub.cloud.common.order.vo.ShopCartItemVO;
import com.tmerclub.cloud.common.product.dto.SkuComboDTO;
import com.tmerclub.cloud.common.product.vo.SkuComboVO;
import com.tmerclub.cloud.product.mapper.SkuComboMapper;
import com.tmerclub.cloud.product.model.SkuCombo;
import com.tmerclub.cloud.product.service.SkuComboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 *
 * @author lhd
 * @date 2023-11-06 15:52:12
 */
@Service
public class SkuComboServiceImpl implements SkuComboService {

    @Autowired
    private SkuComboMapper skuComboMapper;

    @Override
    public void saveBatch(List<SkuComboDTO> skuComboList) {
        skuComboMapper.saveBatch(skuComboList);
    }


    @Override
    public void deleteBySkuIds(List<Long> skuIds) {
        skuComboMapper.deleteBySkuIds(skuIds);
    }

    @Override
    public List<SkuComboVO> getCombSpusBySkuIds(List<Long> skuIds) {
        return skuComboMapper.getCombSpusBySkuIds(skuIds, I18nMessage.getLang());
    }

    @Override
    public List<SkuComboVO> getCombSpusBySpuIds(List<Long> spuIds) {
        return skuComboMapper.getCombSpusBySpuIds(spuIds);
    }

    @Override
    public List<ShopCartItemVO> getCombShopItemsAndBySkuIds(List<Long> skuIds) {
        return skuComboMapper.getCombShopItemsAndBySkuId(skuIds, I18nMessage.getLang());
    }

    @Override
    public List<Long> getCombSpusByComboSpuIds(List<Long> spuIds,List<Long> skuIds) {
        return skuComboMapper.getCombSpusByComboSpuIdsOrSkuIds(spuIds,skuIds);
    }

    @Override
    public void deleteByComboSpuIds(List<Long> spuIds) {
        skuComboMapper.deleteByComboSpuIds(spuIds);
    }

    @Override
    public void deleteByComboSkuIds(List<Long> skuIds) {
        skuComboMapper.deleteByComboSkuIds(skuIds);
    }

    @Override
    public Integer countDisableComboSpuBySpuId(Long spuId) {
        return skuComboMapper.countDisableComboSpuBySpuId(spuId);
    }
}
