2023-09-01 11:47:39 +10:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PARR.EsppTemplateSync.Services
|
2023-08-25 15:32:06 +10:00
|
|
|
|
{
|
|
|
|
|
|
internal class ParserService : IParserService
|
|
|
|
|
|
{
|
2023-09-01 11:47:39 +10:00
|
|
|
|
private readonly ILogger<ParserService> logger;
|
|
|
|
|
|
|
|
|
|
|
|
public ParserService(ILogger<ParserService> logger)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.logger = logger;
|
|
|
|
|
|
}
|
2023-08-31 12:04:05 +10:00
|
|
|
|
public async Task<bool> ParseFileAsync(string path)
|
|
|
|
|
|
{
|
|
|
|
|
|
//TODO:
|
|
|
|
|
|
|
|
|
|
|
|
bool isSuccess = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return isSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<bool> ParseStringAsync(string str)
|
2023-08-25 15:32:06 +10:00
|
|
|
|
{
|
|
|
|
|
|
//TODO:
|
2023-09-01 11:47:39 +10:00
|
|
|
|
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}");
|
2023-08-25 15:32:06 +10:00
|
|
|
|
|
|
|
|
|
|
bool isSuccess = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return isSuccess;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|