40 lines
986 B
C#
40 lines
986 B
C#
using Microsoft.Extensions.Logging;
|
|
using PARR.BLL.Services.Interfaces;
|
|
using PARR.GeneratorTemplates.Settings;
|
|
|
|
namespace PARR.GeneratorTemplates
|
|
{
|
|
internal class GeneratorTemplate : IGeneratorTemplate
|
|
{
|
|
private readonly MqSettings mqSettings;
|
|
private readonly IMqService mqService;
|
|
private readonly ILogger<GeneratorTemplate> logger;
|
|
|
|
public GeneratorTemplate(
|
|
MqSettings mqSettings,
|
|
IMqService mqService,
|
|
ILogger<GeneratorTemplate> logger
|
|
)
|
|
{
|
|
this.mqSettings = mqSettings;
|
|
this.mqService = mqService;
|
|
this.logger = logger;
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
mqService.InitConsumer(mqSettings);
|
|
|
|
mqService.Received += (msg) =>
|
|
{
|
|
logger.LogInformation($"Привет откуда надо!!! ${msg}");
|
|
};
|
|
}
|
|
|
|
public void Stop()
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|