worker чтение ESPPTemplates переведено на очередь MQ

This commit is contained in:
Mikhail Kuznetsov
2023-09-01 11:47:39 +10:00
parent 7ec51c7c98
commit d6f1752465
10 changed files with 122 additions and 14 deletions

View File

@@ -1,15 +1,29 @@
namespace PARR.EsppTemplateSync.Services
using Microsoft.Extensions.Logging;
namespace PARR.EsppTemplateSync.Services
{
internal class Manager : IManager
{
private readonly ILogger<Manager> logger;
private readonly IParserService parserService;
public Manager(ILogger<Manager> logger, IParserService parserService)
{
this.logger = logger;
this.parserService = parserService;
}
public Task<bool> ManageFileAsync(string path)
{
throw new NotImplementedException();
}
public Task<bool> ManageStringAsync(string str)
public async Task<bool> ManageStringAsync(string str)
{
throw new NotImplementedException();
bool isSuccess = true;
//TOD if (str == null || str.Length <= 2)
//var await parserService.ParseStringAsync(str);
return isSuccess;
}
}
}

View File

@@ -1,7 +1,15 @@
namespace PARR.EsppTemplateSync.Services
using Microsoft.Extensions.Logging;
namespace PARR.EsppTemplateSync.Services
{
internal class ParserService : IParserService
{
private readonly ILogger<ParserService> logger;
public ParserService(ILogger<ParserService> logger)
{
this.logger = logger;
}
public async Task<bool> ParseFileAsync(string path)
{
//TODO:
@@ -15,6 +23,10 @@
public async Task<bool> ParseStringAsync(string str)
{
//TODO:
var splittedContent = str.Split(";");
var ek = splittedContent[0].Trim().Substring(1, splittedContent[0].Length - 2);
var isActive = splittedContent[1].Trim().Substring(1, splittedContent[1].Length - 2);
logger.LogInformation($"Получено сообщение: {ek}");
bool isSuccess = true;