2025-05-19 16:09:55 +10:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using PARR.AIHITMainSyncer.Services;
|
|
|
|
|
|
using PARR.AIHITMainSyncer.Settings;
|
2026-04-14 16:27:27 +10:00
|
|
|
|
using PARR.Core;
|
2025-05-19 16:09:55 +10:00
|
|
|
|
using PARR.DAL;
|
2026-04-14 16:27:27 +10:00
|
|
|
|
using PARR.Infrastructure;
|
2025-05-19 16:09:55 +10:00
|
|
|
|
|
|
|
|
|
|
namespace PARR.AIHITMainSyncer
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class AihitMainSyncerInstaller
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void InstallAihitMainSyncerServices(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
|
{
|
2026-04-30 10:35:31 +10:00
|
|
|
|
services.AddDalServices(configuration);
|
2026-04-14 16:27:27 +10:00
|
|
|
|
services.AddCoreServices(configuration);
|
|
|
|
|
|
services.AddInfrastructureServices(configuration);
|
2025-05-19 16:09:55 +10:00
|
|
|
|
|
|
|
|
|
|
var settings = new WorkerSettings();
|
|
|
|
|
|
configuration.GetSection(nameof(WorkerSettings)).Bind(settings);
|
|
|
|
|
|
services.AddSingleton(settings);
|
|
|
|
|
|
|
|
|
|
|
|
var mqSettings = new MqSettings();
|
|
|
|
|
|
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
|
|
|
|
|
|
services.AddSingleton(mqSettings);
|
|
|
|
|
|
|
2025-11-27 17:11:14 +10:00
|
|
|
|
var fieldValueReplacementsSettings = new FieldValueReplacementsSettings();
|
|
|
|
|
|
configuration.GetSection(nameof(FieldValueReplacementsSettings)).Bind(fieldValueReplacementsSettings);
|
|
|
|
|
|
services.AddSingleton(fieldValueReplacementsSettings);
|
|
|
|
|
|
|
2025-05-19 16:09:55 +10:00
|
|
|
|
services.AddTransient<IAihitMainSyncer, AihitMainSyncer>();
|
|
|
|
|
|
services.AddTransient<ISyncerService, SyncerService>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static IConfigurationBuilder AddAihitMainSyncerConfigurations(this IConfigurationBuilder builder, IServiceCollection services)
|
|
|
|
|
|
{
|
|
|
|
|
|
builder.AddDalConfigurations(services);
|
|
|
|
|
|
|
|
|
|
|
|
return builder;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void AddAihitMainSyncerSettings(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
|
{
|
|
|
|
|
|
services.AddDallSettings(configuration);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|