MES-ETL/MesETL.App/Options/DataInputOptions.cs

73 lines
2.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using MesETL.App.HostedServices;
namespace MesETL.App.Options
{
public class DataInputOptions
{
/// <summary>
/// 文件输入的目录
/// </summary>
public string? InputDir { get; set; }
#region CSV
/// <summary>
/// 字符串的包围符号,默认为双引号"
/// </summary>
public char QuoteChar { get; set; } = '"';
/// <summary>
/// 每个字段的分割符,默认逗号,
/// </summary>
public string Delimiter { get; set; } = ",";
#endregion
#region Mock
/// <summary>
/// <para>生成模拟数据进行测试</para>
/// <para>启用后在读取数据时会截取ZST文件中的CSV文件的第一条记录然后复制成指定数量的数据</para>
/// </summary>
public bool UseMock { get; set; }
/// <summary>
/// 当开启模拟数据生成时,模拟数据的倍数
/// </summary>
public double MockCountMultiplier { get; set; } = 1;
/// <summary>
/// 配置每张表生成模拟数据的规则,此属性暂时在程序中配置
/// </summary>
public Dictionary<string, TableMockConfig>? TableMockConfig { get; set; }
#endregion
#region Reader
/// <summary>
/// <para>配置输入表及其顺序,如果为空则按照程序默认的顺序。</para>
/// <para>该值如果存在,程序会按照集合中表的顺序来读取数据,不在集合中的表将被忽略!</para>
/// </summary>
public string[]? TableOrder { get; set; }
/// <summary>
/// 忽略集合中配置的表,不进行读取
/// </summary>
public string[] TableIgnoreList { get; set; } = [];
/// <summary>
/// 配置如何从文件名转换为表名和表头
/// </summary>
public Func<string, FileInputInfo?>? FileInputMetaBuilder { get; set; }
/// <summary>
/// 表输入完成事件
/// </summary>
public Action<string>? OnTableInputCompleted { get; set; }
#endregion
}
}