package com.fs.course.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.course.mapper.FsUserCourseCommentLikeMapper;
import com.fs.course.domain.FsUserCourseCommentLike;
import com.fs.course.service.IFsUserCourseCommentLikeService;

/**
 * 课堂评论点赞Service业务层处理
 *
 * @author fs
 * @date 2024-05-15
 */
@Service
public class FsUserCourseCommentLikeServiceImpl implements IFsUserCourseCommentLikeService
{
    @Autowired
    private FsUserCourseCommentLikeMapper fsUserCourseCommentLikeMapper;

    /**
     * 查询课堂评论点赞
     *
     * @param id 课堂评论点赞主键
     * @return 课堂评论点赞
     */
    @Override
    public FsUserCourseCommentLike selectFsUserCourseCommentLikeById(Long id)
    {
        return fsUserCourseCommentLikeMapper.selectFsUserCourseCommentLikeById(id);
    }

    /**
     * 查询课堂评论点赞列表
     *
     * @param fsUserCourseCommentLike 课堂评论点赞
     * @return 课堂评论点赞
     */
    @Override
    public List<FsUserCourseCommentLike> selectFsUserCourseCommentLikeList(FsUserCourseCommentLike fsUserCourseCommentLike)
    {
        return fsUserCourseCommentLikeMapper.selectFsUserCourseCommentLikeList(fsUserCourseCommentLike);
    }

    /**
     * 新增课堂评论点赞
     *
     * @param fsUserCourseCommentLike 课堂评论点赞
     * @return 结果
     */
    @Override
    public int insertFsUserCourseCommentLike(FsUserCourseCommentLike fsUserCourseCommentLike)
    {
        fsUserCourseCommentLike.setCreateTime(DateUtils.getNowDate());
        return fsUserCourseCommentLikeMapper.insertFsUserCourseCommentLike(fsUserCourseCommentLike);
    }

    /**
     * 修改课堂评论点赞
     *
     * @param fsUserCourseCommentLike 课堂评论点赞
     * @return 结果
     */
    @Override
    public int updateFsUserCourseCommentLike(FsUserCourseCommentLike fsUserCourseCommentLike)
    {
        fsUserCourseCommentLike.setUpdateTime(DateUtils.getNowDate());
        return fsUserCourseCommentLikeMapper.updateFsUserCourseCommentLike(fsUserCourseCommentLike);
    }

    /**
     * 批量删除课堂评论点赞
     *
     * @param ids 需要删除的课堂评论点赞主键
     * @return 结果
     */
    @Override
    public int deleteFsUserCourseCommentLikeByIds(Long[] ids)
    {
        return fsUserCourseCommentLikeMapper.deleteFsUserCourseCommentLikeByIds(ids);
    }

    /**
     * 删除课堂评论点赞信息
     *
     * @param id 课堂评论点赞主键
     * @return 结果
     */
    @Override
    public int deleteFsUserCourseCommentLikeById(Long id)
    {
        return fsUserCourseCommentLikeMapper.deleteFsUserCourseCommentLikeById(id);
    }

    @Override
    public FsUserCourseCommentLike selectFsUserCourseCommentLikeByUserIdAndCommentId(Long userId, Long commentId) {

        return  fsUserCourseCommentLikeMapper.selectFsUserCourseCommentLikeByUserIdAndCommentId(userId,commentId);

    }
}
