Add data parser base classes
This commit is contained in:
14
Hcs.WebApp/BackgroundServices/DataParsers/DataParserBase.cs
Normal file
14
Hcs.WebApp/BackgroundServices/DataParsers/DataParserBase.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
@ -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)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
namespace Hcs.WebApp.BackgroundServices.DataParsers
|
||||
{
|
||||
public class IDataParser
|
||||
public interface IDataParser
|
||||
{
|
||||
Task<bool> ParseAsync();
|
||||
}
|
||||
}
|
||||
|
||||
6
Hcs.WebApp/BackgroundServices/DataParsingService.cs
Normal file
6
Hcs.WebApp/BackgroundServices/DataParsingService.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Hcs.WebApp.BackgroundServices
|
||||
{
|
||||
public class DataParsingService
|
||||
{
|
||||
}
|
||||
}
|
||||
6
Hcs.WebApp/BackgroundServices/DataParsingState.cs
Normal file
6
Hcs.WebApp/BackgroundServices/DataParsingState.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Hcs.WebApp.BackgroundServices
|
||||
{
|
||||
public class DataParsingState
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user