package com.fs.delivery.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.delivery.mapper.CtShortVideoMapper;
import com.fs.delivery.domain.CtShortVideo;
import com.fs.delivery.service.ICtShortVideoService;

/**
 * 长视频Service业务层处理
 * 
 * @author fs
 * @date 2026-01-22
 */
@Service
public class CtShortVideoServiceImpl implements ICtShortVideoService 
{
    @Autowired
    private CtShortVideoMapper ctShortVideoMapper;

    /**
     * 查询长视频
     * 
     * @param id 长视频主键
     * @return 长视频
     */
    @Override
    public CtShortVideo selectCtShortVideoById(Long id)
    {
        return ctShortVideoMapper.selectCtShortVideoById(id);
    }

    /**
     * 查询长视频列表
     * 
     * @param ctShortVideo 长视频
     * @return 长视频
     */
    @Override
    public List<CtShortVideo> selectCtShortVideoList(CtShortVideo ctShortVideo)
    {
        return ctShortVideoMapper.selectCtShortVideoList(ctShortVideo);
    }

    /**
     * 新增长视频
     * 
     * @param ctShortVideo 长视频
     * @return 结果
     */
    @Override
    public int insertCtShortVideo(CtShortVideo ctShortVideo)
    {
        ctShortVideo.setCreateTime(DateUtils.getNowDate());
        return ctShortVideoMapper.insertCtShortVideo(ctShortVideo);
    }

    /**
     * 修改长视频
     * 
     * @param ctShortVideo 长视频
     * @return 结果
     */
    @Override
    public int updateCtShortVideo(CtShortVideo ctShortVideo)
    {
        ctShortVideo.setUpdateTime(DateUtils.getNowDate());
        return ctShortVideoMapper.updateCtShortVideo(ctShortVideo);
    }

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

    /**
     * 删除长视频信息
     * 
     * @param id 长视频主键
     * @return 结果
     */
    @Override
    public int deleteCtShortVideoById(Long id)
    {
        return ctShortVideoMapper.deleteCtShortVideoById(id);
    }
}
