feat(EsppSync): общая логика для синхронизации шаблонов и расписаний

This commit is contained in:
Mikhail Trubnikov
2023-11-22 11:37:22 +10:00
parent c88f7f2731
commit fffdb134c6
8 changed files with 206 additions and 7 deletions

View File

@@ -0,0 +1,26 @@
using PARR.DAL.Contracts;
using PARR.DAL.Models;
namespace PARR.EsppSync
{
/// <summary>
/// Делегат парсинга из строки в модель EsppObject
/// </summary>
/// <typeparam name="EsppObject"></typeparam>
/// <param name="str"></param>
/// <returns></returns>
public delegate EsppObject ParserHandlerDelegate<EsppObject>(string str) where EsppObject : class, IEsppObject;
/// <summary>
/// Конвертирует Template в модель для сравнения
/// </summary>
/// <typeparam name="EsppObject"></typeparam>
/// <param name="templateName"></param>
/// <returns></returns>
public delegate EsppObject ConvertDbObjToComparisonObjHandlerDelegate<EsppObject>(Template template) where EsppObject : class, IEsppObject;
public interface ISyncService<EsppObject> where EsppObject : class, IEsppObject
{
Task SyncEsppObjectAsync(string str, ParserHandlerDelegate<EsppObject> parser, ConvertDbObjToComparisonObjHandlerDelegate<EsppObject> converterToEsppObject, RobotsEnum robot);
}
}