feat(aititMainLoader): Сделана основная логика загрущки данных из АИХ ИТ в очередь сообщений
This commit is contained in:
40
PARR.AIHITMainLoader/AihitMainLoaderInstaller.cs
Normal file
40
PARR.AIHITMainLoader/AihitMainLoaderInstaller.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PARR.AIHITMainLoader.Context;
|
||||
using PARR.AIHITMainLoader.Services;
|
||||
using PARR.AIHITMainLoader.Settings;
|
||||
using PARR.BLL;
|
||||
|
||||
namespace PARR.AIHITMainLoader
|
||||
{
|
||||
public static class AihitMainLoaderInstaller
|
||||
{
|
||||
public static void InstallAihitMainLoaderServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.InstallBllServices(configuration);
|
||||
|
||||
var settings = new WorkerSettings();
|
||||
configuration.GetSection(nameof(WorkerSettings)).Bind(settings);
|
||||
services.AddSingleton(settings);
|
||||
|
||||
var loaderSettings = new LoaderSettings();
|
||||
configuration.GetSection(nameof(LoaderSettings)).Bind(loaderSettings);
|
||||
services.AddSingleton(loaderSettings);
|
||||
|
||||
var mqSettings = new MqSettings();
|
||||
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
|
||||
services.AddSingleton(mqSettings);
|
||||
|
||||
services.AddDbContext<AIHITContext>(options =>
|
||||
options.UseSqlServer(
|
||||
configuration.GetConnectionString("AihitConnection"),
|
||||
sqlServerOptions => sqlServerOptions.CommandTimeout(1800)
|
||||
));
|
||||
|
||||
services.AddTransient<IAihitService, AihitService>();
|
||||
services.AddTransient<IAihitMainLoader, AihitMainLoader>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user