Implement result getter
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
using Hcs.Broker;
|
||||
using Hcs.WebApp.Data.Hcs;
|
||||
using Hcs.WebApp.Services;
|
||||
|
||||
namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
|
||||
{
|
||||
public class ExportNsiItemGetter_15_7_0_1(IClient client, IServiceScope scope, Operation operation) : ResultGetterBase(client, scope, operation)
|
||||
{
|
||||
public override async Task<ResultGetterResponse> GetAsync()
|
||||
{
|
||||
var result = await client.NsiCommon.GetExportNsiItemResultAsync(operation.MessageGuid!);
|
||||
if (!result.Ready)
|
||||
{
|
||||
return ResultGetterResponse.NotReady;
|
||||
}
|
||||
|
||||
if (result.Success)
|
||||
{
|
||||
var registryService = scope.ServiceProvider.GetRequiredService<RegistryService>();
|
||||
var registry = await registryService.GetRegistryByOperationIdAsync(operation.Id);
|
||||
// TODO
|
||||
|
||||
return ResultGetterResponse.Successful;
|
||||
}
|
||||
|
||||
return ResultGetterResponse.Failed;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user