package com.ruoyi.model.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppBannerMapper;
import com.ruoyi.model.domain.AppBanner;
import com.ruoyi.model.service.IAppBannerService;

/**
 * 轮播图Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-04
 */
@Service
public class AppBannerServiceImpl implements IAppBannerService 
{
    @Autowired
    private AppBannerMapper appBannerMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public AppBanner selectAppBannerById(Long id)
    {
        return appBannerMapper.selectAppBannerById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param appBanner 轮播图
     * @return 轮播图
     */
    @Override
    public List<AppBanner> selectAppBannerList(AppBanner appBanner)
    {
        return appBannerMapper.selectAppBannerList(appBanner);
    }

    /**
     * 新增轮播图
     * 
     * @param appBanner 轮播图
     * @return 结果
     */
    @Override
    public int insertAppBanner(AppBanner appBanner)
    {
        appBanner.setCreateTime(DateUtils.getNowDate());
        return appBannerMapper.insertAppBanner(appBanner);
    }

    /**
     * 修改轮播图
     * 
     * @param appBanner 轮播图
     * @return 结果
     */
    @Override
    public int updateAppBanner(AppBanner appBanner)
    {
        appBanner.setUpdateTime(DateUtils.getNowDate());
        return appBannerMapper.updateAppBanner(appBanner);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteAppBannerByIds(Long[] ids)
    {
        return appBannerMapper.deleteAppBannerByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteAppBannerById(Long id)
    {
        return appBannerMapper.deleteAppBannerById(id);
    }

    @Override
    public List<AppBanner> getBannerList() {
        return appBannerMapper.getBannerList();
    }
}
