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.PlayletPublicDetailMapper;
import com.playlet.system.domain.PlayletPublicDetail;
import com.playlet.system.service.IPlayletPublicDetailService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 公众号文章详情Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-07
 */
@Service
public class PlayletPublicDetailServiceImpl extends ServiceImpl<PlayletPublicDetailMapper, PlayletPublicDetail> implements IPlayletPublicDetailService
{
    @Autowired
    private PlayletPublicDetailMapper playletPublicDetailMapper;

    /**
     * 查询公众号文章详情
     *
     * @param id 公众号文章详情主键
     * @return 公众号文章详情
     */
    @Override
    public PlayletPublicDetail selectPlayletPublicDetailById(Long id)
    {
        return playletPublicDetailMapper.selectPlayletPublicDetailById(id);
    }

    /**
     * 查询公众号文章详情列表
     *
     * @param playletPublicDetail 公众号文章详情
     * @return 公众号文章详情
     */
    @Override
    public List<PlayletPublicDetail> selectPlayletPublicDetailList(PlayletPublicDetail playletPublicDetail)
    {
        return playletPublicDetailMapper.selectPlayletPublicDetailList(playletPublicDetail);
    }

    /**
     * 新增公众号文章详情
     *
     * @param playletPublicDetail 公众号文章详情
     * @return 结果
     */
    @Override
    public int insertPlayletPublicDetail(PlayletPublicDetail playletPublicDetail)
    {
        playletPublicDetail.setCreateTime(DateUtils.getNowDate());
        return playletPublicDetailMapper.insertPlayletPublicDetail(playletPublicDetail);
    }

    /**
     * 修改公众号文章详情
     *
     * @param playletPublicDetail 公众号文章详情
     * @return 结果
     */
    @Override
    public int updatePlayletPublicDetail(PlayletPublicDetail playletPublicDetail)
    {
        playletPublicDetail.setUpdateTime(DateUtils.getNowDate());
        return playletPublicDetailMapper.updatePlayletPublicDetail(playletPublicDetail);
    }

    /**
     * 批量删除公众号文章详情
     *
     * @param ids 需要删除的公众号文章详情主键
     * @return 结果
     */
    @Override
    public int deletePlayletPublicDetailByIds(String ids)
    {
        return playletPublicDetailMapper.deletePlayletPublicDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除公众号文章详情信息
     *
     * @param id 公众号文章详情主键
     * @return 结果
     */
    @Override
    public int deletePlayletPublicDetailById(Long id)
    {
        return playletPublicDetailMapper.deletePlayletPublicDetailById(id);
    }
}
