package com.ruoyi.rocketmq.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rocketmq.mapper.RmAlarmPushConfigMapper;
import com.ruoyi.rocketmq.domain.RmAlarmPushConfig;
import com.ruoyi.rocketmq.service.IRmAlarmPushConfigService;

/**
 * 告警推送配置Service业务层处理
 * 
 * @author gyt
 * @date 2025-11-11
 */
@Service
public class RmAlarmPushConfigServiceImpl implements IRmAlarmPushConfigService 
{
    @Autowired
    private RmAlarmPushConfigMapper rmAlarmPushConfigMapper;

    /**
     * 查询告警推送配置
     * 
     * @param id 告警推送配置主键
     * @return 告警推送配置
     */
    @Override
    public RmAlarmPushConfig selectRmAlarmPushConfigById(Long id)
    {
        return rmAlarmPushConfigMapper.selectRmAlarmPushConfigById(id);
    }

    /**
     * 查询告警推送配置列表
     * 
     * @param rmAlarmPushConfig 告警推送配置
     * @return 告警推送配置
     */
    @Override
    public List<RmAlarmPushConfig> selectRmAlarmPushConfigList(RmAlarmPushConfig rmAlarmPushConfig)
    {
        return rmAlarmPushConfigMapper.selectRmAlarmPushConfigList(rmAlarmPushConfig);
    }

    /**
     * 新增告警推送配置
     * 
     * @param rmAlarmPushConfig 告警推送配置
     * @return 结果
     */
    @Override
    public int insertRmAlarmPushConfig(RmAlarmPushConfig rmAlarmPushConfig)
    {
        rmAlarmPushConfig.setCreateTime(DateUtils.getNowDate());
        return rmAlarmPushConfigMapper.insertRmAlarmPushConfig(rmAlarmPushConfig);
    }

    /**
     * 修改告警推送配置
     * 
     * @param rmAlarmPushConfig 告警推送配置
     * @return 结果
     */
    @Override
    public int updateRmAlarmPushConfig(RmAlarmPushConfig rmAlarmPushConfig)
    {
        rmAlarmPushConfig.setUpdateTime(DateUtils.getNowDate());
        return rmAlarmPushConfigMapper.updateRmAlarmPushConfig(rmAlarmPushConfig);
    }

    /**
     * 批量删除告警推送配置
     * 
     * @param ids 需要删除的告警推送配置主键
     * @return 结果
     */
    @Override
    public int deleteRmAlarmPushConfigByIds(Long[] ids)
    {
        return rmAlarmPushConfigMapper.deleteRmAlarmPushConfigByIds(ids);
    }

    /**
     * 删除告警推送配置信息
     * 
     * @param id 告警推送配置主键
     * @return 结果
     */
    @Override
    public int deleteRmAlarmPushConfigById(Long id)
    {
        return rmAlarmPushConfigMapper.deleteRmAlarmPushConfigById(id);
    }
}
