using Microsoft.Extensions.DependencyInjection;
using System;
using System.Threading.Tasks;
using Wood.Data.Repository;
using Wood.Entity;
using Wood.Entity.SystemManage;
using Wood.EventBus;
using Wood.EventBus.Events;
using Wood.Util;
namespace Wood.Service.Events
{
///
/// 异常日志保存事件
///
public class LogExceptionEventHandler : IntegrationEventHandler, ISingleton
{
///
/// 保存异常信息
///
///
///
///
public override async Task Run(LogExceptionEvent @event,IServiceScope scope)
{
await scope.ServiceProvider.GetRequiredService>().InsertAsync(@event.GetPayload()!);
}
}
}