forked from ddrilling/AsbCloudServer
Рефакторинг домена
1. Разделил сервисы парсинга. 2. Выделил интерфейс маркер для доп. параметров парсинга. Данный сервис применяется только для ограничения обощённых параметров.
This commit is contained in:
parent
a47a5799c1
commit
501ef52938
@ -1,17 +0,0 @@
|
|||||||
namespace AsbCloudApp.Requests.Import;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Параметры парсинга
|
|
||||||
/// </summary>
|
|
||||||
public abstract class ParserOptionsRequestBase
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Id сервиса для парсинга
|
|
||||||
/// </summary>
|
|
||||||
public int IdParserService { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Название листа в файле Excel
|
|
||||||
/// </summary>
|
|
||||||
public string SheetName { get; set; } = null!;
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
namespace AsbCloudApp.Requests.Import;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Параметры парсинга траекторий
|
|
||||||
/// </summary>
|
|
||||||
public class TrajectoryParserRequest : ParserOptionsRequestBase
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Количество строк заголовка
|
|
||||||
/// </summary>
|
|
||||||
public int HeaderRowsCount { get; set; }
|
|
||||||
}
|
|
@ -0,0 +1,8 @@
|
|||||||
|
namespace AsbCloudApp.Requests.ParserOptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Интерфейс для параметров парсера
|
||||||
|
/// </summary>
|
||||||
|
public interface IParserOptionsRequest
|
||||||
|
{
|
||||||
|
}
|
19
AsbCloudApp/Services/Parser/IParserService.cs
Normal file
19
AsbCloudApp/Services/Parser/IParserService.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System.IO;
|
||||||
|
using AsbCloudApp.Data;
|
||||||
|
|
||||||
|
namespace AsbCloudApp.Services.Parser;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Сервис парсинга файлов
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TDto"></typeparam>
|
||||||
|
public interface IParserService<TDto>
|
||||||
|
where TDto : class, IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Распарсить файл
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
ParserResultDto<TDto> Parse(Stream file);
|
||||||
|
}
|
@ -1,17 +1,17 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using AsbCloudApp.Data;
|
using AsbCloudApp.Data;
|
||||||
using AsbCloudApp.Requests.Import;
|
using AsbCloudApp.Requests.ParserOptions;
|
||||||
|
|
||||||
namespace AsbCloudApp.Services;
|
namespace AsbCloudApp.Services.Parser;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Сервис парсинга файлов
|
/// Сервис парсинга файлов с доп. параметрами
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="TDto"></typeparam>
|
/// <typeparam name="TDto"></typeparam>
|
||||||
/// <typeparam name="TOptions"></typeparam>
|
/// <typeparam name="TOptions"></typeparam>
|
||||||
public interface IParserService<TDto, in TOptions> : IParserService
|
public interface IParserServiceWithOptions<TDto, in TOptions>
|
||||||
where TDto : class, IId
|
where TDto : class, IId
|
||||||
where TOptions : ParserOptionsRequestBase
|
where TOptions : IParserOptionsRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Распарсить файл
|
/// Распарсить файл
|
||||||
@ -21,10 +21,3 @@ public interface IParserService<TDto, in TOptions> : IParserService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
ParserResultDto<TDto> Parse(Stream file, TOptions options);
|
ParserResultDto<TDto> Parse(Stream file, TOptions options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Сервис парсинга файлов
|
|
||||||
/// </summary>
|
|
||||||
public interface IParserService
|
|
||||||
{
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user