添加项目文件。

This commit is contained in:
dell
2023-03-03 16:07:50 +08:00
parent 2c462551b6
commit 011039960e
585 changed files with 362460 additions and 0 deletions

View File

@ -0,0 +1,32 @@
using Jaina;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using HT.Cloud.Code;
using HT.Cloud.Domain.SystemSecurity;
using HT.Cloud.Service.SystemSecurity;
namespace HT.Cloud.Service.Event
{
// 实现 IEventSubscriber 接口
public class LogEventSubscriber : IEventSubscriber
{
public LogEventSubscriber()
{
}
[EventSubscribe("Log:create")]
public async Task SendMessages(EventHandlerExecutingContext context)
{
var todo = (BaseEventSource)context.Source;
var input = (LogEntity)todo.Payload;
var user = todo.User;
using (var serviceProvider = GlobalContext.RootServices.CreateScope())
{
var logService = serviceProvider.ServiceProvider.GetService<LogService>();
await logService.WriteDbLog(input, user);
}
await Task.CompletedTask;
}
}
}