| 123456789101112131415161718192021222324252627 |
- using Admin.NET.Plugin.AiDOP.Entity.S8;
- namespace Admin.NET.Plugin.AiDOP.Service.S8;
- /// <summary>
- /// 通知发送服务。首轮实现:将通知意图序列化为 JSON 写入 <see cref="AdoS8NotificationLog"/>,
- /// 不做实际推送。后续接入钉钉/企微/邮件时替换此服务内部实现即可,外部接口不变。
- /// </summary>
- public class S8NotificationService : ITransient
- {
- private readonly SqlSugarRepository<AdoS8NotificationLog> _logRep;
- public S8NotificationService(SqlSugarRepository<AdoS8NotificationLog> logRep) => _logRep = logRep;
- public async Task SendAsync(long tenantId, long factoryId, long? exceptionId, string channel, object payload)
- {
- await _logRep.InsertAsync(new AdoS8NotificationLog
- {
- TenantId = tenantId,
- FactoryId = factoryId,
- ExceptionId = exceptionId,
- Channel = channel,
- Payload = System.Text.Json.JsonSerializer.Serialize(payload),
- CreatedAt = DateTime.Now
- });
- }
- }
|