Рефакторинг интерфейсов экспорта

This commit is contained in:
Степанов Дмитрий 2024-03-14 13:16:56 +03:00
parent b662f13819
commit e3a7767a41
5 changed files with 50 additions and 38 deletions

View File

@ -0,0 +1,8 @@
namespace AsbCloudApp.Requests.ExportOptions;
/// <summary>
/// Параметры экспорта
/// </summary>
public interface IExportOptionsRequest
{
}

View File

@ -0,0 +1,21 @@
namespace AsbCloudApp.Requests.ExportOptions;
/// <summary>
/// Параметры экспорта
/// </summary>
public class WellRelatedExportRequest : IExportOptionsRequest
{
/// <summary>
/// Конструктор
/// </summary>
/// <param name="idWell">Id скважины</param>
public WellRelatedExportRequest(int idWell)
{
IdWell = idWell;
}
/// <summary>
/// Id скважины
/// </summary>
public int IdWell { get; }
}

View File

@ -0,0 +1,21 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using AsbCloudApp.Requests.ExportOptions;
namespace AsbCloudApp.Services;
/// <summary>
/// Экспорт данных
/// </summary>
public interface IExportService<in TOptions>
where TOptions : IExportOptionsRequest
{
/// <summary>
/// Экспортировать данные
/// </summary>
/// <param name="options"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<(string FileName, Stream File)> ExportAsync(TOptions options, CancellationToken token);
}

View File

@ -1,19 +0,0 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Services;
/// <summary>
/// Экспорт РТК
/// </summary>
public interface IProcessMapPlanExportService
{
/// <summary>
/// Экспортировать РТК по скважине
/// </summary>
/// <param name="idWell"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<(string FileName, Stream File)> ExportAsync(int idWell, CancellationToken token);
}

View File

@ -1,19 +0,0 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Services;
/// <summary>
/// Экспорт траекторий
/// </summary>
public interface ITrajectoryExportService
{
/// <summary>
/// Экспортировать траектории по скважине
/// </summary>
/// <param name="idWell"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<(string FileName, Stream File)> ExportAsync(int idWell, CancellationToken token);
}