namespace Admin.NET.Plugin.ApprovalFlow.Service; /// /// 审批流通知推送器抽象(P4-16) /// 每种渠道一个实现,注册到 DI 容器,由 FlowNotifyService 按配置 + 启用状态并行调度。 /// public interface INotifyPusher { /// /// 渠道名(SignalR / Email / Sms / DingTalk / WorkWeixin),与 NotifyChannelConfig 属性名一致 /// string Channel { get; } /// /// 根据配置判断当前渠道是否启用 /// bool IsEnabled(NotifyChannelConfig cfg); /// /// 实际推送 /// /// 目标用户 Id 列表(SignalR/Email/Sms 直接定位人;DingTalk/WorkWeixin Webhook 忽略,由群机器人向群成员广播) /// 通知载荷 /// 推送结果(含是否成功、目标数、耗时、错误) Task PushAsync(List userIds, FlowNotification notification); } /// /// 单次推送结果 /// public class FlowNotifyPushResult { public bool Success { get; set; } public int ActualTargetCount { get; set; } public string? ErrorMessage { get; set; } public static FlowNotifyPushResult Ok(int count) => new() { Success = true, ActualTargetCount = count }; public static FlowNotifyPushResult Fail(string error) => new() { Success = false, ErrorMessage = error }; }