2023-11-22 14:19:15 +10:00
|
|
|
|
using PARR.DAL.Models;
|
2023-11-22 11:37:22 +10:00
|
|
|
|
|
|
|
|
|
|
namespace PARR.EsppSync
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Делегат парсинга из строки в модель EsppObject
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <typeparam name="EsppObject"></typeparam>
|
|
|
|
|
|
/// <param name="str"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2023-11-22 14:19:15 +10:00
|
|
|
|
public delegate EsppObject? ParserHandlerDelegate<EsppObject>(string str) where EsppObject : class, IEsppObject;
|
2023-11-22 11:37:22 +10:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Конвертирует Template в модель для сравнения
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <typeparam name="EsppObject"></typeparam>
|
|
|
|
|
|
/// <param name="templateName"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2025-08-06 10:33:55 +10:00
|
|
|
|
public delegate EsppObject ConvertDbObjToComparisonObjHandlerDelegate<EsppObject>(Template template) where EsppObject : class, IEsppObject;
|
2023-11-22 11:37:22 +10:00
|
|
|
|
|
|
|
|
|
|
public interface ISyncService<EsppObject> where EsppObject : class, IEsppObject
|
|
|
|
|
|
{
|
2024-02-28 10:17:01 +10:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="str">Строка из RabbitMQ</param>
|
|
|
|
|
|
/// <param name="parser">Делегат парсинга из строки в модель EsppObject</param>
|
|
|
|
|
|
/// <param name="converterToEsppObject"> Конвертирует BD Template в модель для сравнения</param>
|
|
|
|
|
|
/// <returns></returns>
|
2023-11-22 12:04:33 +10:00
|
|
|
|
Task SyncEsppObjectAsync(string str, ParserHandlerDelegate<EsppObject> parser, ConvertDbObjToComparisonObjHandlerDelegate<EsppObject> converterToEsppObject);
|
2023-11-22 11:37:22 +10:00
|
|
|
|
}
|
|
|
|
|
|
}
|