package com.dkl.large.service.impl;

import java.util.List;
import com.dkl.common.utils.DateUtils;
import com.dkl.large.domain.DklClip;
import com.dkl.large.mapper.DklClipMapper;
import com.dkl.large.service.IDklClipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 视频Service业务层处理
 *
 * @author Dkl
 * @date 2025-11-03
 */
@Service
public class DklClipServiceImpl implements IDklClipService
{
    @Autowired
    private DklClipMapper dklClipMapper;

    /**
     * 查询视频
     *
     * @param id 视频主键
     * @return 视频
     */
    @Override
    public DklClip selectDklClipById(Long id)
    {
        return dklClipMapper.selectDklClipById(id);
    }

    /**
     * 查询视频列表
     *
     * @param dklClip 视频
     * @return 视频
     */
    @Override
    public List<DklClip> selectDklClipList(DklClip dklClip)
    {
        return dklClipMapper.selectDklClipList(dklClip);
    }

    /**
     * 新增视频
     *
     * @param dklClip 视频
     * @return 结果
     */
    @Override
    public int insertDklClip(DklClip dklClip)
    {
        dklClip.setCreateTime(DateUtils.getNowDate());
        return dklClipMapper.insertDklClip(dklClip);
    }

    /**
     * 修改视频
     *
     * @param dklClip 视频
     * @return 结果
     */
    @Override
    public int updateDklClip(DklClip dklClip)
    {
        dklClip.setUpdateTime(DateUtils.getNowDate());
        return dklClipMapper.updateDklClip(dklClip);
    }

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

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