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

/**
 * 短剧公告Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-10
 */
@Service
public class PlayletMessageServiceImpl extends ServiceImpl<PlayletMessageMapper, PlayletMessage> implements IPlayletMessageService
{
    @Autowired
    private PlayletMessageMapper playletMessageMapper;

    /**
     * 查询短剧公告
     *
     * @param id 短剧公告主键
     * @return 短剧公告
     */
    @Override
    public PlayletMessage selectPlayletMessageById(Long id)
    {
        return playletMessageMapper.selectPlayletMessageById(id);
    }

    /**
     * 查询短剧公告列表
     *
     * @param playletMessage 短剧公告
     * @return 短剧公告
     */
    @Override
    public List<PlayletMessage> selectPlayletMessageList(PlayletMessage playletMessage)
    {
        return playletMessageMapper.selectPlayletMessageList(playletMessage);
    }

    /**
     * 新增短剧公告
     *
     * @param playletMessage 短剧公告
     * @return 结果
     */
    @Override
    public int insertPlayletMessage(PlayletMessage playletMessage)
    {
        playletMessage.setCreateTime(DateUtils.getNowDate());
        return playletMessageMapper.insertPlayletMessage(playletMessage);
    }

    /**
     * 修改短剧公告
     *
     * @param playletMessage 短剧公告
     * @return 结果
     */
    @Override
    public int updatePlayletMessage(PlayletMessage playletMessage)
    {
        playletMessage.setUpdateTime(DateUtils.getNowDate());
        return playletMessageMapper.updatePlayletMessage(playletMessage);
    }

    /**
     * 批量删除短剧公告
     *
     * @param ids 需要删除的短剧公告主键
     * @return 结果
     */
    @Override
    public int deletePlayletMessageByIds(String ids)
    {
        return playletMessageMapper.deletePlayletMessageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除短剧公告信息
     *
     * @param id 短剧公告主键
     * @return 结果
     */
    @Override
    public int deletePlayletMessageById(Long id)
    {
        return playletMessageMapper.deletePlayletMessageById(id);
    }
}
