package com.ruoyi.abuwx.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.abuwx.mapper.VideoCategoryMapper;
import com.ruoyi.abuwx.domain.VideoCategory;
import com.ruoyi.abuwx.service.IVideoCategoryService;

/**
 * 视频分类Service业务层处理
 * 
 * @author lujie
 * @date 2024-12-20
 */
@Service
public class VideoCategoryServiceImpl implements IVideoCategoryService 
{
    @Autowired
    private VideoCategoryMapper videoCategoryMapper;

    /**
     * 查询视频分类
     * 
     * @param id 视频分类主键
     * @return 视频分类
     */
    @Override
    public VideoCategory selectVideoCategoryById(Long id)
    {
        return videoCategoryMapper.selectVideoCategoryById(id);
    }

    /**
     * 查询视频分类列表
     * 
     * @param videoCategory 视频分类
     * @return 视频分类
     */
    @Override
    public List<VideoCategory> selectVideoCategoryList(VideoCategory videoCategory)
    {
        return videoCategoryMapper.selectVideoCategoryList(videoCategory);
    }

    /**
     * 新增视频分类
     * 
     * @param videoCategory 视频分类
     * @return 结果
     */
    @Override
    public int insertVideoCategory(VideoCategory videoCategory)
    {
        videoCategory.setCreateTime(DateUtils.getNowDate());
        return videoCategoryMapper.insertVideoCategory(videoCategory);
    }

    /**
     * 修改视频分类
     * 
     * @param videoCategory 视频分类
     * @return 结果
     */
    @Override
    public int updateVideoCategory(VideoCategory videoCategory)
    {
        videoCategory.setUpdateTime(DateUtils.getNowDate());
        return videoCategoryMapper.updateVideoCategory(videoCategory);
    }

    /**
     * 批量删除视频分类
     * 
     * @param ids 需要删除的视频分类主键
     * @return 结果
     */
    @Override
    public int deleteVideoCategoryByIds(Long[] ids)
    {
        return videoCategoryMapper.deleteVideoCategoryByIds(ids);
    }

    /**
     * 删除视频分类信息
     * 
     * @param id 视频分类主键
     * @return 结果
     */
    @Override
    public int deleteVideoCategoryById(Long id)
    {
        return videoCategoryMapper.deleteVideoCategoryById(id);
    }
}
