package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GoodsCartMapper;
import com.ruoyi.system.domain.GoodsCart;
import com.ruoyi.system.service.IGoodsCartService;

/**
 * 购物车Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-13
 */
@Service
public class GoodsCartServiceImpl implements IGoodsCartService 
{
    @Autowired
    private GoodsCartMapper goodsCartMapper;

    /**
     * 查询购物车
     * 
     * @param id 购物车主键
     * @return 购物车
     */
    @Override
    public GoodsCart selectGoodsCartById(Integer id)
    {
        return goodsCartMapper.selectGoodsCartById(id);
    }

    /**
     * 查询购物车列表
     * 
     * @param goodsCart 购物车
     * @return 购物车
     */
    @Override
    public List<GoodsCart> selectGoodsCartList(GoodsCart goodsCart)
    {
        return goodsCartMapper.selectGoodsCartList(goodsCart);
    }

    /**
     * 新增购物车
     * 
     * @param goodsCart 购物车
     * @return 结果
     */
    @Override
    public int insertGoodsCart(GoodsCart goodsCart)
    {
        return goodsCartMapper.insertGoodsCart(goodsCart);
    }

    /**
     * 修改购物车
     * 
     * @param goodsCart 购物车
     * @return 结果
     */
    @Override
    public int updateGoodsCart(GoodsCart goodsCart)
    {
        return goodsCartMapper.updateGoodsCart(goodsCart);
    }

    /**
     * 批量删除购物车
     * 
     * @param ids 需要删除的购物车主键
     * @return 结果
     */
    @Override
    public int deleteGoodsCartByIds(Integer[] ids)
    {
        return goodsCartMapper.deleteGoodsCartByIds(ids);
    }

    /**
     * 删除购物车信息
     * 
     * @param id 购物车主键
     * @return 结果
     */
    @Override
    public int deleteGoodsCartById(Integer id)
    {
        return goodsCartMapper.deleteGoodsCartById(id);
    }
}
