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

51 lines
1.6 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 enum ColumnType
{
Blob,
Text,
Json,
UnDefine,
}
public class DataTransformOptions
{
public bool StrictMode { get; set; } = true;
public bool EnableFilter { get; set; } = true;
public bool EnableReplacer { get; set; } = true;
public bool EnableReBuilder { get; set; } = true;
/// <summary>
/// yyyyMM
/// </summary>
public string CleanDate { get; set; } = "202401";
/// <summary>
/// Record -> Database name
/// 决定记录应当被插入到哪一个数据库中
/// </summary>
public Func<DataRecord, string>? DatabaseFilter { get; set; }
/// <summary>
/// Context -> Should output
/// 对记录进行过滤返回false则不输出
/// </summary>
public Func<DataTransformContext, Task<bool>>? RecordFilter { get; set; }//数据过滤方法
/// <summary>
/// Context -> New record
/// 对当前记录进行修改或完整替换,你可以在这里修改记录中的字段,或者新增/删除字段
/// </summary>
public Func<DataTransformContext, Task<DataRecord>>? RecordModify { get; set; }//数据替换
/// <summary>
/// Context -> New rebuild records
/// 基于当前记录新增多个记录
/// </summary>
public Func<DataTransformContext, IList<DataRecord>?>? RecordReBuild { get; set; }//新增数据
/// <summary>
/// Context -> void
/// 对数据的某些字段进行缓存
/// </summary>
public Func<DataTransformContext, Task>? RecordCache { get; set; }//数据缓存
}