mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-05-04 12:02:51 +08:00
21 lines
702 B
C#
21 lines
702 B
C#
using NetAdmin.Domain.Events;
|
|
using NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
|
|
|
namespace NetAdmin.SysComponent.Host.Subscribers;
|
|
|
|
/// <summary>
|
|
/// Api接口同步器
|
|
/// </summary>
|
|
public sealed class ApiSynchronizer(ILogger<ApiSynchronizer> logger) : IEventSubscriber
|
|
{
|
|
/// <summary>
|
|
/// 同步Api接口
|
|
/// </summary>
|
|
[EventSubscribe(nameof(SyncStructureAfterEvent))]
|
|
public async Task SyncApiAsync(EventHandlerExecutingContext _)
|
|
{
|
|
var logService = App.GetService<IApiService>();
|
|
await logService.SyncAsync().ConfigureAwait(false);
|
|
logger.Info($"{nameof(IApiService)}.{nameof(IApiService.SyncAsync)} {Ln.已完成}");
|
|
}
|
|
} |