package com.ruoyi.framework.recovery.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.framework.recovery.mapper.RecContentMapper;
import com.ruoyi.framework.recovery.domain.RecContent;
import com.ruoyi.framework.recovery.service.IRecContentService;

/**
 * 评论Service业务层处理
 *
 * @author jin
 * @date 2024-11-16
 */
@Service
public class RecContentServiceImpl implements IRecContentService
{
    @Autowired
    private RecContentMapper recContentMapper;

    /**
     * 查询评论
     *
     * @param id 评论主键
     * @return 评论
     */
    @Override
    public RecContent selectRecContentById(Long id)
    {
        return recContentMapper.selectRecContentById(id);
    }

    /**
     * 查询评论列表
     *
     * @param recContent 评论
     * @return 评论
     */
    @Override
    public List<RecContent> selectRecContentList(RecContent recContent)
    {
        return recContentMapper.selectRecContentList(recContent);
    }

    /**
     * 新增评论
     *
     * @param recContent 评论
     * @return 结果
     */
    @Override
    public int insertRecContent(RecContent recContent)
    {
        recContent.setCreateDate(new Date());
        return recContentMapper.insertRecContent(recContent);
    }

    /**
     * 修改评论
     *
     * @param recContent 评论
     * @return 结果
     */
    @Override
    public int updateRecContent(RecContent recContent)
    {
        return recContentMapper.updateRecContent(recContent);
    }

    /**
     * 批量删除评论
     *
     * @param ids 需要删除的评论主键
     * @return 结果
     */
    @Override
    public int deleteRecContentByIds(Long[] ids)
    {
        return recContentMapper.deleteRecContentByIds(ids);
    }

    /**
     * 删除评论信息
     *
     * @param id 评论主键
     * @return 结果
     */
    @Override
    public int deleteRecContentById(Long id)
    {
        return recContentMapper.deleteRecContentById(id);
    }
}
