wlzboy
8 天以前 09faa36132c8cbada5327649875534ef01c1a3b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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 发送结果信息
     */
    void markSendSuccess(Long id, String result);
 
    /**
     * 更新发送状态为失败
     * 
     * @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);
 
    /**
     * 查询待重试的失败记录
     * 
     * @param maxRetryCount 最大重试次数
     * @return 失败记录列表
     */
    List<NotifySendLog> selectFailedNotifySendLogs(Integer maxRetryCount);
}