package com.ruoyi.mall.service.impl;

import com.ruoyi.mall.domain.MallAppGoods;
import com.ruoyi.mall.mapper.MallAppGoodsMapper;
import com.ruoyi.mall.service.IMallAppGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * app商品Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-21
 */
@Service
public class MallAppGoodsServiceImpl implements IMallAppGoodsService {
    @Autowired
    private MallAppGoodsMapper mallAppGoodsMapper;

    /**
     * 查询app商品
     *
     * @param id app商品主键
     * @return app商品
     */
    @Override
    public MallAppGoods selectMallAppGoodsById(Long id) {
        return mallAppGoodsMapper.selectMallAppGoodsById(id);
    }

    /**
     * 查询app商品列表
     *
     * @param mallAppGoods app商品
     * @return app商品
     */
    @Override
    public List<MallAppGoods> selectMallAppGoodsList(MallAppGoods mallAppGoods) {
        return mallAppGoodsMapper.selectMallAppGoodsList(mallAppGoods);
    }

    /**
     * 新增app商品
     *
     * @param mallAppGoods app商品
     * @return 结果
     */
    @Override
    public int insertMallAppGoods(MallAppGoods mallAppGoods) {
        return mallAppGoodsMapper.insertMallAppGoods(mallAppGoods);
    }

    /**
     * 修改app商品
     *
     * @param mallAppGoods app商品
     * @return 结果
     */
    @Override
    public int updateMallAppGoods(MallAppGoods mallAppGoods) {
        return mallAppGoodsMapper.updateMallAppGoods(mallAppGoods);
    }

    /**
     * 批量删除app商品
     *
     * @param ids 需要删除的app商品主键
     * @return 结果
     */
    @Override
    public int deleteMallAppGoodsByIds(Long[] ids) {
        return mallAppGoodsMapper.deleteMallAppGoodsByIds(ids);
    }

    /**
     * 删除app商品信息
     *
     * @param id app商品主键
     * @return 结果
     */
    @Override
    public int deleteMallAppGoodsById(Long id) {
        return mallAppGoodsMapper.deleteMallAppGoodsById(id);
    }


    @Override
    public List<MallAppGoods> selectMallAppGoodsListByname(String name) {
        return mallAppGoodsMapper.selectMallAppGoodsListByname(name);
    }
}
