using ConsoleApp2.Helpers; using ConsoleApp2.HostedServices.Abstractions; using Microsoft.Extensions.Logging; using ServiceStack.Text; namespace ConsoleApp2.Services; /// /// 读取Jsv格式文件 /// [Obsolete] public class JsvSource:IDataSource { private readonly string _inputDir; private readonly JsvStringSerializer _jsv; private readonly StreamReader _reader; // ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable private readonly ILogger? _logger; private readonly string _tableName; public DataRecord Current { get; protected set; } = null!; public string[]? Headers { get; } public bool EndOfSource => _reader.EndOfStream; public JsvSource(string inputDir,string tableName, ILogger? logger = null) { _inputDir = inputDir; _tableName = tableName; _jsv = new JsvStringSerializer(); // _reader = new StreamReader(filePath); //Headers = headers; _logger = logger; // _logger?.LogInformation("Reading file: {FilePath}", filePath); //_tableName = DumpDataHelper.GetTableName(filePath); } public async Task DoEnqueue(Action action) { } public void Dispose() { _reader.Dispose(); } }