package com.fs.course.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.common.utils.DateUtils;
import com.fs.course.domain.FsCourseSopAppLink;
import com.fs.course.mapper.FsCourseSopAppLinkMapper;
import com.fs.course.service.IFsCourseSopAppLinkService;
import com.fs.course.vo.FsSopMyCourseLinkVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * sop发送app消息的记录Service业务层处理
 *
 * @author fs
 * @date 2025-03-20
 */
@Service
public class FsCourseSopAppLinkServiceImpl extends ServiceImpl<FsCourseSopAppLinkMapper, FsCourseSopAppLink> implements IFsCourseSopAppLinkService {

    /**
     * 查询sop发送app消息的记录
     *
     * @param id sop发送app消息的记录主键
     * @return sop发送app消息的记录
     */
    @Override
    public FsCourseSopAppLink selectFsCourseSopAppLinkById(Long id)
    {
        return baseMapper.selectFsCourseSopAppLinkById(id);
    }

    /**
     * 查询sop发送app消息的记录列表
     *
     * @param fsCourseSopAppLink sop发送app消息的记录
     * @return sop发送app消息的记录
     */
    @Override
    public List<FsCourseSopAppLink> selectFsCourseSopAppLinkList(FsCourseSopAppLink fsCourseSopAppLink)
    {
        return baseMapper.selectFsCourseSopAppLinkList(fsCourseSopAppLink);
    }

    /**
     * 新增sop发送app消息的记录
     *
     * @param fsCourseSopAppLink sop发送app消息的记录
     * @return 结果
     */
    @Override
    public int insertFsCourseSopAppLink(FsCourseSopAppLink fsCourseSopAppLink)
    {
        fsCourseSopAppLink.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertFsCourseSopAppLink(fsCourseSopAppLink);
    }

    /**
     * 修改sop发送app消息的记录
     *
     * @param fsCourseSopAppLink sop发送app消息的记录
     * @return 结果
     */
    @Override
    public int updateFsCourseSopAppLink(FsCourseSopAppLink fsCourseSopAppLink)
    {
        fsCourseSopAppLink.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateFsCourseSopAppLink(fsCourseSopAppLink);
    }

    /**
     * 批量删除sop发送app消息的记录
     *
     * @param ids 需要删除的sop发送app消息的记录主键
     * @return 结果
     */
    @Override
    public int deleteFsCourseSopAppLinkByIds(Long[] ids)
    {
        return baseMapper.deleteFsCourseSopAppLinkByIds(ids);
    }

    /**
     * 删除sop发送app消息的记录信息
     *
     * @param id sop发送app消息的记录主键
     * @return 结果
     */
    @Override
    public int deleteFsCourseSopAppLinkById(Long id)
    {
        return baseMapper.deleteFsCourseSopAppLinkById(id);
    }

    @Override
    public List<FsSopMyCourseLinkVO> getSopCourseStudyList(Long userId) {
        return baseMapper.getSopCourseStudyList(userId);
    }
}
