package com.playlet.system.service.impl;

import java.util.List;
import com.playlet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.playlet.system.mapper.PublicCommentResponseMapper;
import com.playlet.system.domain.PublicCommentResponse;
import com.playlet.system.service.IPublicCommentResponseService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 作者回复评论记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-20
 */
@Service
public class PublicCommentResponseServiceImpl extends ServiceImpl<PublicCommentResponseMapper, PublicCommentResponse> implements IPublicCommentResponseService
{
    @Autowired
    private PublicCommentResponseMapper publicCommentResponseMapper;

    /**
     * 查询作者回复评论记录
     *
     * @param id 作者回复评论记录主键
     * @return 作者回复评论记录
     */
    @Override
    public PublicCommentResponse selectPublicCommentResponseById(Long id)
    {
        return publicCommentResponseMapper.selectPublicCommentResponseById(id);
    }

    /**
     * 查询作者回复评论记录列表
     *
     * @param publicCommentResponse 作者回复评论记录
     * @return 作者回复评论记录
     */
    @Override
    public List<PublicCommentResponse> selectPublicCommentResponseList(PublicCommentResponse publicCommentResponse)
    {
        return publicCommentResponseMapper.selectPublicCommentResponseList(publicCommentResponse);
    }

    /**
     * 新增作者回复评论记录
     *
     * @param publicCommentResponse 作者回复评论记录
     * @return 结果
     */
    @Override
    public int insertPublicCommentResponse(PublicCommentResponse publicCommentResponse)
    {
        publicCommentResponse.setCreateTime(DateUtils.getNowDate());
        return publicCommentResponseMapper.insertPublicCommentResponse(publicCommentResponse);
    }

    /**
     * 修改作者回复评论记录
     *
     * @param publicCommentResponse 作者回复评论记录
     * @return 结果
     */
    @Override
    public int updatePublicCommentResponse(PublicCommentResponse publicCommentResponse)
    {
        publicCommentResponse.setUpdateTime(DateUtils.getNowDate());
        return publicCommentResponseMapper.updatePublicCommentResponse(publicCommentResponse);
    }

    /**
     * 批量删除作者回复评论记录
     *
     * @param ids 需要删除的作者回复评论记录主键
     * @return 结果
     */
    @Override
    public int deletePublicCommentResponseByIds(String ids)
    {
        return publicCommentResponseMapper.deletePublicCommentResponseByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除作者回复评论记录信息
     *
     * @param id 作者回复评论记录主键
     * @return 结果
     */
    @Override
    public int deletePublicCommentResponseById(Long id)
    {
        return publicCommentResponseMapper.deletePublicCommentResponseById(id);
    }
}
