package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TextMessageMapper;
import com.ruoyi.system.domain.TextMessage;
import com.ruoyi.system.service.ITextMessageService;

/**
 * 短信设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-20
 */
@Service
public class TextMessageServiceImpl implements ITextMessageService 
{
    @Autowired
    private TextMessageMapper textMessageMapper;

    /**
     * 查询短信设置
     * 
     * @param id 短信设置ID
     * @return 短信设置
     */
    @Override
    public TextMessage selectTextMessageById(Long id)
    {
        return textMessageMapper.selectTextMessageById(id);
    }

    /**
     * 查询短信设置列表
     * 
     * @param textMessage 短信设置
     * @return 短信设置
     */
    @Override
    public List<TextMessage> selectTextMessageList(TextMessage textMessage)
    {
        return textMessageMapper.selectTextMessageList(textMessage);
    }

    /**
     * 新增短信设置
     * 
     * @param textMessage 短信设置
     * @return 结果
     */
    @Override
    public int insertTextMessage(TextMessage textMessage)
    {
        textMessage.setCreateTime(DateUtils.getNowDate());
        return textMessageMapper.insertTextMessage(textMessage);
    }

    /**
     * 修改短信设置
     * 
     * @param textMessage 短信设置
     * @return 结果
     */
    @Override
    public int updateTextMessage(TextMessage textMessage)
    {
        textMessage.setUpdateTime(DateUtils.getNowDate());
        return textMessageMapper.updateTextMessage(textMessage);
    }

    /**
     * 批量删除短信设置
     * 
     * @param ids 需要删除的短信设置ID
     * @return 结果
     */
    @Override
    public int deleteTextMessageByIds(Long[] ids)
    {
        return textMessageMapper.deleteTextMessageByIds(ids);
    }

    /**
     * 删除短信设置信息
     * 
     * @param id 短信设置ID
     * @return 结果
     */
    @Override
    public int deleteTextMessageById(Long id)
    {
        return textMessageMapper.deleteTextMessageById(id);
    }
}
