Adding
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
using LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
namespace LCU.API.Internal.LoanRate.Services.QueueServices;
|
||||
|
||||
public interface IQueueLoadTestInitiateService
|
||||
{
|
||||
Task QueueLoadTestInitiateRequest(LoadTestInitiateRequest request);
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
using LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
namespace LCU.API.Internal.LoanRate.Services.QueueServices;
|
||||
|
||||
public interface IQueueLoadTestProcessRateService
|
||||
{
|
||||
Task QueueLoadTestProcessRateRequest(LoadTestProcessRateRequest request);
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
using LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
namespace LCU.API.Internal.LoanRate.Services.QueueServices;
|
||||
|
||||
public interface IQueueLoadTestRateCompletionService
|
||||
{
|
||||
Task QueueLoadTestRateCompletionRequest(LoadTestRateCompletionRequest request);
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using MassTransit;
|
||||
using LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
using LCU.Api.Internal.MaidBotLib.Models;
|
||||
using LCU.API.Internal.LoanRate.Configurations;
|
||||
namespace LCU.API.Internal.LoanRate.Services.QueueServices;
|
||||
|
||||
public class QueueLoadTestInitiateService : IQueueLoadTestInitiateService
|
||||
{
|
||||
private readonly ISendEndpoint _sendEndpoint;
|
||||
|
||||
public QueueLoadTestInitiateService(IBusControl busControl,
|
||||
ReceiveEndpointConfigurations receiveEndpointConfigurations)
|
||||
{
|
||||
_sendEndpoint = busControl.GetSendEndpoint(receiveEndpointConfigurations.LoadTestInitiateReceiveEndpoint.ReceiveEndpointUri).Result;
|
||||
}
|
||||
|
||||
public async Task QueueLoadTestInitiateRequest(LoadTestInitiateRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));
|
||||
await _sendEndpoint.Send(request, cancellationTokenSource.Token);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.ForContext(Enum.GetName(typeof(PropertyEnum), PropertyEnum.Group),
|
||||
Enum.GetName(typeof(GroupEnum), GroupEnum.ITDevelopment))
|
||||
.Fatal(exception, "Failed to Queue Load Test Initiate Request.");
|
||||
throw new ServiceException("Failed to Queue Load Test Initiate Request.");
|
||||
}
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using MassTransit;
|
||||
using LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
using LCU.Api.Internal.MaidBotLib.Models;
|
||||
using LCU.API.Internal.LoanRate.Configurations;
|
||||
namespace LCU.API.Internal.LoanRate.Services.QueueServices;
|
||||
|
||||
public class QueueLoadTestProcessRateService : IQueueLoadTestProcessRateService
|
||||
{
|
||||
private readonly ISendEndpoint _sendEndpoint;
|
||||
|
||||
public QueueLoadTestProcessRateService(IBusControl busControl,
|
||||
ReceiveEndpointConfigurations receiveEndpointConfigurations)
|
||||
{
|
||||
_sendEndpoint = busControl.GetSendEndpoint(receiveEndpointConfigurations.LoadTestProcessRateReceiveEndpoint.ReceiveEndpointUri).Result;
|
||||
}
|
||||
|
||||
public async Task QueueLoadTestProcessRateRequest(LoadTestProcessRateRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));
|
||||
await _sendEndpoint.Send(request, cancellationTokenSource.Token);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.ForContext(Enum.GetName(typeof(PropertyEnum), PropertyEnum.Group),
|
||||
Enum.GetName(typeof(GroupEnum), GroupEnum.ITDevelopment))
|
||||
.Fatal(exception, "Failed to Queue Load Test Process Rate Request.");
|
||||
throw new ServiceException("Failed to Queue Load Test Process Rate Request.");
|
||||
}
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using MassTransit;
|
||||
using LCU.Library.Internal.LoanRateModels.Requests.LoadTestRequest;
|
||||
using LCU.Api.Internal.MaidBotLib.Models;
|
||||
using LCU.API.Internal.LoanRate.Configurations;
|
||||
namespace LCU.API.Internal.LoanRate.Services.QueueServices;
|
||||
|
||||
public class QueueLoadTestRateCompletionService : IQueueLoadTestRateCompletionService
|
||||
{
|
||||
private readonly ISendEndpoint _sendEndpoint;
|
||||
|
||||
public QueueLoadTestRateCompletionService(IBusControl busControl,
|
||||
ReceiveEndpointConfigurations receiveEndpointConfigurations)
|
||||
{
|
||||
_sendEndpoint = busControl.GetSendEndpoint(receiveEndpointConfigurations.LoadTestRateCompletionReceiveEndpoint.ReceiveEndpointUri).Result;
|
||||
}
|
||||
|
||||
public async Task QueueLoadTestRateCompletionRequest(LoadTestRateCompletionRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));
|
||||
await _sendEndpoint.Send(request, cancellationTokenSource.Token);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.ForContext(Enum.GetName(typeof(PropertyEnum), PropertyEnum.Group),
|
||||
Enum.GetName(typeof(GroupEnum), GroupEnum.ITDevelopment))
|
||||
.Fatal(exception, "Failed to Queue Load Test Rate Completion Request.");
|
||||
throw new ServiceException("Failed to Queue Load Test Rate Completion Request.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user