feat(templateTaskGenerator): Написан TemplateTaskGenerator, читает очередь Mq parr-template-task-generator при получении id регламентной работы проверяет несозданные шаблоны. При наличии таковых пишет сообщение в очередь parr-template-generator
This commit is contained in:
38
TemplateTaskGenerator/TemplateTaskGeneratorInstaller.cs
Normal file
38
TemplateTaskGenerator/TemplateTaskGeneratorInstaller.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PARR.BLL;
|
||||
using PARR.DAL;
|
||||
using PARR.TemplateTaskGenerator.Services;
|
||||
using PARR.TemplateTaskGenerator.Settings;
|
||||
|
||||
namespace PARR.TemplateTaskGenerator
|
||||
{
|
||||
public static class TemplateTaskGeneratorInstaller
|
||||
{
|
||||
public static void InstallTemplateTaskGeneratorSerivces(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<IMqTemplateTaskGenerator, MqTemplateTaskGenerator>();
|
||||
services.AddTransient<IValidatorService, ValidatorService>();
|
||||
services.AddTransient<ITemplateTaskGenerator, TemplateTaskGenerator>();
|
||||
}
|
||||
|
||||
public static IConfigurationBuilder AddTemplateTaskGeneratorConfigurations(this IConfigurationBuilder builder, IServiceCollection services)
|
||||
{
|
||||
builder.AddDalConfigurations(services);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static void AddTemplateTaskGeneratorSettings(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddDallSettings(configuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user