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.PublicDetailShareMapper;
import com.playlet.system.domain.PublicDetailShare;
import com.playlet.system.service.IPublicDetailShareService;
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 PublicDetailShareServiceImpl extends ServiceImpl<PublicDetailShareMapper, PublicDetailShare> implements IPublicDetailShareService
{
    @Autowired
    private PublicDetailShareMapper publicDetailShareMapper;

    /**
     * 查询文章分享记录
     *
     * @param id 文章分享记录主键
     * @return 文章分享记录
     */
    @Override
    public PublicDetailShare selectPublicDetailShareById(Long id)
    {
        return publicDetailShareMapper.selectPublicDetailShareById(id);
    }

    /**
     * 查询文章分享记录列表
     *
     * @param publicDetailShare 文章分享记录
     * @return 文章分享记录
     */
    @Override
    public List<PublicDetailShare> selectPublicDetailShareList(PublicDetailShare publicDetailShare)
    {
        return publicDetailShareMapper.selectPublicDetailShareList(publicDetailShare);
    }

    /**
     * 新增文章分享记录
     *
     * @param publicDetailShare 文章分享记录
     * @return 结果
     */
    @Override
    public int insertPublicDetailShare(PublicDetailShare publicDetailShare)
    {
        publicDetailShare.setCreateTime(DateUtils.getNowDate());
        return publicDetailShareMapper.insertPublicDetailShare(publicDetailShare);
    }

    /**
     * 修改文章分享记录
     *
     * @param publicDetailShare 文章分享记录
     * @return 结果
     */
    @Override
    public int updatePublicDetailShare(PublicDetailShare publicDetailShare)
    {
        publicDetailShare.setUpdateTime(DateUtils.getNowDate());
        return publicDetailShareMapper.updatePublicDetailShare(publicDetailShare);
    }

    /**
     * 批量删除文章分享记录
     *
     * @param ids 需要删除的文章分享记录主键
     * @return 结果
     */
    @Override
    public int deletePublicDetailShareByIds(String ids)
    {
        return publicDetailShareMapper.deletePublicDetailShareByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除文章分享记录信息
     *
     * @param id 文章分享记录主键
     * @return 结果
     */
    @Override
    public int deletePublicDetailShareById(Long id)
    {
        return publicDetailShareMapper.deletePublicDetailShareById(id);
    }
}
