feat(aihit): AIHITLoadWorker + AIHITSyncWorker
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PARR.AIHITLoader.Context;
|
||||
using PARR.AIHITLoader.Services;
|
||||
using PARR.AIHITLoader.Settings;
|
||||
using PARR.BLL;
|
||||
|
||||
namespace PARR.AIHITLoader
|
||||
@@ -10,6 +14,27 @@ namespace PARR.AIHITLoader
|
||||
{
|
||||
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<IAihitLoader, AihitLoader>();
|
||||
services.AddTransient<IAIHITService, AIHITService>();
|
||||
|
||||
//todo: config e.t.c
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user