package com.ruoyi.system.service;
|
|
import java.util.List;
|
import com.ruoyi.system.domain.NotifySendLog;
|
|
/**
|
* 通知发送记录服务接口
|
*
|
* @author ruoyi
|
* @date 2025-12-07
|
*/
|
public interface INotifySendLogService {
|
|
/**
|
* 查询通知发送记录
|
*
|
* @param id 通知发送记录主键
|
* @return 通知发送记录
|
*/
|
NotifySendLog selectNotifySendLogById(Long id);
|
|
/**
|
* 查询通知发送记录列表
|
*
|
* @param notifySendLog 通知发送记录
|
* @return 通知发送记录集合
|
*/
|
List<NotifySendLog> selectNotifySendLogList(NotifySendLog notifySendLog);
|
|
/**
|
* 检查是否已发送过通知(防重检查)
|
*
|
* @param taskId 任务ID
|
* @param userId 用户ID
|
* @param notifyType 通知类型
|
* @param channel 通知渠道
|
* @return true=已发送过, false=未发送过
|
*/
|
boolean hasNotified(Long taskId, Long userId, String notifyType, String channel);
|
|
/**
|
* 尝试创建发送记录(防重,如果已存在则返回false)
|
*
|
* @param taskId 任务ID
|
* @param userId 用户ID
|
* @param userName 用户姓名
|
* @param notifyType 通知类型
|
* @param channel 通知渠道
|
* @return 创建的记录,如果已存在则返回null
|
*/
|
NotifySendLog tryCreateSendLog(Long taskId, Long userId, String userName,
|
String notifyType, String channel);
|
|
/**
|
* 更新发送状态为成功
|
*
|
* @param id 记录ID
|
* @param result 发送结果信息
|
* @param content 发送内容
|
*/
|
void markSendSuccess(Long id, String result, String content);
|
|
/**
|
* 更新发送状态为成功(向后兼容)
|
*
|
* @param id 记录ID
|
* @param result 发送结果信息
|
*/
|
void markSendSuccess(Long id, String result);
|
|
/**
|
* 更新发送状态为失败
|
*
|
* @param id 记录ID
|
* @param errorMsg 错误信息
|
* @param content 发送内容
|
*/
|
void markSendFailed(Long id, String errorMsg, String content);
|
|
/**
|
* 更新发送状态为失败(向后兼容)
|
*
|
* @param id 记录ID
|
* @param errorMsg 错误信息
|
*/
|
void markSendFailed(Long id, String errorMsg);
|
|
/**
|
* 新增通知发送记录
|
*
|
* @param notifySendLog 通知发送记录
|
* @return 结果
|
*/
|
int insertNotifySendLog(NotifySendLog notifySendLog);
|
|
/**
|
* 修改通知发送记录
|
*
|
* @param notifySendLog 通知发送记录
|
* @return 结果
|
*/
|
int updateNotifySendLog(NotifySendLog notifySendLog);
|
|
/**
|
* 批量删除通知发送记录
|
*
|
* @param ids 需要删除的通知发送记录主键集合
|
* @return 结果
|
*/
|
int deleteNotifySendLogByIds(Long[] ids);
|
|
/**
|
* 删除通知发送记录信息
|
*
|
* @param id 通知发送记录主键
|
* @return 结果
|
*/
|
int deleteNotifySendLogById(Long id);
|
|
/**
|
* 根据任务ID和用户ID查询发送记录
|
*
|
* @param taskId 任务ID
|
* @param userId 用户ID
|
* @param notifyType 通知类型
|
* @param channel 通知渠道
|
* @return 通知发送记录
|
*/
|
NotifySendLog selectNotifySendLog(Long taskId, Long userId, String notifyType, String channel);
|
/**
|
* 查询待重试的失败记录
|
*
|
* @param maxRetryCount 最大重试次数
|
* @return 失败记录列表
|
*/
|
}
|