package com.ruoyi.system.service.impl; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.system.domain.NotifyChannelConfig; import com.ruoyi.system.mapper.NotifyChannelConfigMapper; import com.ruoyi.system.service.INotifyChannelConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * 通知渠道配置Service业务层处理 * * @author ruoyi * @date 2025-12-07 */ @Service public class NotifyChannelConfigServiceImpl implements INotifyChannelConfigService { @Autowired private NotifyChannelConfigMapper notifyChannelConfigMapper; /** * 查询通知渠道配置 * * @param id 主键ID * @return 通知渠道配置 */ @Override public NotifyChannelConfig selectNotifyChannelConfigById(Long id) { return notifyChannelConfigMapper.selectNotifyChannelConfigById(id); } /** * 查询通知渠道配置列表 * * @param notifyChannelConfig 查询条件 * @return 通知渠道配置列表 */ @Override public List selectNotifyChannelConfigList(NotifyChannelConfig notifyChannelConfig) { return notifyChannelConfigMapper.selectNotifyChannelConfigList(notifyChannelConfig); } /** * 查询指定通知类型启用的渠道配置 * 按优先级降序排列 * * @param notifyType 通知类型 * @return 启用的渠道配置列表 */ @Override public List selectEnabledChannelsByType(String notifyType) { return notifyChannelConfigMapper.selectEnabledChannelsByType(notifyType); } /** * 检查指定渠道是否启用 * * @param notifyType 通知类型 * @param channel 渠道 * @return 配置信息 */ @Override public NotifyChannelConfig selectByTypeAndChannel(String notifyType, String channel) { return notifyChannelConfigMapper.selectByTypeAndChannel(notifyType, channel); } /** * 新增通知渠道配置 * * @param notifyChannelConfig 通知渠道配置 * @return 结果 */ @Override public int insertNotifyChannelConfig(NotifyChannelConfig notifyChannelConfig) { notifyChannelConfig.setCreateTime(DateUtils.getNowDate()); notifyChannelConfig.setUpdateTime(DateUtils.getNowDate()); return notifyChannelConfigMapper.insertNotifyChannelConfig(notifyChannelConfig); } /** * 修改通知渠道配置 * * @param notifyChannelConfig 通知渠道配置 * @return 结果 */ @Override public int updateNotifyChannelConfig(NotifyChannelConfig notifyChannelConfig) { notifyChannelConfig.setUpdateTime(DateUtils.getNowDate()); return notifyChannelConfigMapper.updateNotifyChannelConfig(notifyChannelConfig); } /** * 批量删除通知渠道配置 * * @param ids 需要删除的主键ID集合 * @return 结果 */ @Override public int deleteNotifyChannelConfigByIds(Long[] ids) { return notifyChannelConfigMapper.deleteNotifyChannelConfigByIds(ids); } }