feat(EsppSync): общая логика для синхронизации шаблонов и расписаний
This commit is contained in:
26
PARR.EsppSync/ISyncService.cs
Normal file
26
PARR.EsppSync/ISyncService.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user