feat(templateMatcher): init. сделан воркер, контроллер. перенесена логика из TemplateTaskGenerator
This commit is contained in:
39
PARR.TemplateMatcher/TemplateMatcherInstaller.cs
Normal file
39
PARR.TemplateMatcher/TemplateMatcherInstaller.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PARR.BLL;
|
||||
using PARR.DAL;
|
||||
using PARR.TemplateMatcher.Services.Implemetaions;
|
||||
using PARR.TemplateMatcher.Services.Interfaces;
|
||||
using PARR.TemplateMatcher.Settings;
|
||||
|
||||
namespace PARR.TemplateMatcher
|
||||
{
|
||||
public static class TemplateMatcherInstaller
|
||||
{
|
||||
public static void InstallTemplateMatcherSerivces(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.InstallBllServices(configuration);
|
||||
services.InstallDalServices(configuration);
|
||||
|
||||
var mqSettings = new MqSettings();
|
||||
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
|
||||
services.AddSingleton(mqSettings);
|
||||
|
||||
services.AddTransient<IMqTemplateMatcher, MqTemplateMatcher>();
|
||||
services.AddTransient<IJobValidatorService, JobValidatorService>();
|
||||
services.AddTransient<ITemplateMatcher, TemplateMatcher>();
|
||||
}
|
||||
|
||||
public static IConfigurationBuilder AddTemplateMatcherConfigurations(this IConfigurationBuilder builder, IServiceCollection services)
|
||||
{
|
||||
builder.AddDalConfigurations(services);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static void AddTemplateMatcherSettings(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddDallSettings(configuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user