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 LogOperationEventHandler : IntegrationEventHandler, ISingleton { /// /// 保存日志 /// /// /// /// public override async Task Run(LogOperationEvent @event, IServiceScope scope) { await scope.ServiceProvider.GetRequiredService>().InsertAsync(@event.GetPayload()!); } } }