Add data parser base classes

This commit is contained in:
2025-11-16 16:21:50 +09:00
parent f007d4da19
commit 7991c558cd
7 changed files with 61 additions and 2 deletions

View File

@ -0,0 +1,14 @@
using Hcs.Broker;
using Hcs.WebApp.Data.Hcs;
namespace Hcs.WebApp.BackgroundServices.DataParsers
{
public abstract class DataParserBase(IClient client, IServiceScope scope, Operation operation) : IDataParser
{
protected readonly IClient client = client;
protected readonly IServiceScope scope = scope;
protected readonly Operation operation = operation;
public abstract Task<bool> ParseAsync();
}
}

View File

@ -0,0 +1,16 @@
using Hcs.Broker;
using Hcs.WebApp.Data.Hcs;
namespace Hcs.WebApp.BackgroundServices.DataParsers
{
public class DataParserFactory
{
public IDataParser CreateResultGetter(IServiceScope scope, IClient client, Operation operation)
{
return operation.Type switch
{
Operation.OperationType.ParseHousesData_15_7_0_1 => new HousesDataParser_15_7_0_1(client, scope, operation)
};
}
}
}

View File

@ -0,0 +1,13 @@
using Hcs.Broker;
using Hcs.WebApp.Data.Hcs;
namespace Hcs.WebApp.BackgroundServices.DataParsers
{
public class HousesDataParser_15_7_0_1(IClient client, IServiceScope scope, Operation operation) : DataParserBase(client, scope, operation)
{
public override Task<bool> ParseAsync()
{
throw new NotImplementedException();
}
}
}

View File

@ -1,6 +1,7 @@
namespace Hcs.WebApp.BackgroundServices.DataParsers
{
public class IDataParser
public interface IDataParser
{
Task<bool> ParseAsync();
}
}

View File

@ -0,0 +1,6 @@
namespace Hcs.WebApp.BackgroundServices
{
public class DataParsingService
{
}
}

View File

@ -0,0 +1,6 @@
namespace Hcs.WebApp.BackgroundServices
{
public class DataParsingState
{
}
}