feat(GtxMessagingService): Empfänger- und Nachrichteneingaben zur SendSms-Methode über SMS-Parameter hinzugefügt
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using DigitalData.Core.Abstractions.Client;
|
||||
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
@@ -7,14 +8,20 @@ namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
private readonly IHttpClientService<SmsParams> _smsClient;
|
||||
|
||||
public GtxMessagingService(IHttpClientService<SmsParams> smsClient)
|
||||
private readonly SmsParams _smsParams;
|
||||
|
||||
public GtxMessagingService(IHttpClientService<SmsParams> smsClient, IOptions<SmsParams> smsParamsOptions)
|
||||
{
|
||||
_smsClient = smsClient;
|
||||
_smsParams = smsParamsOptions.Value;
|
||||
}
|
||||
|
||||
public async Task SendSms()
|
||||
public async Task SendSms(string recipient, string message)
|
||||
{
|
||||
await _smsClient.FetchAsync();
|
||||
await _smsClient.FetchAsync(queryParams: new Dictionary<string, object?>() {
|
||||
{ _smsParams.RecipientQueryParamName, recipient },
|
||||
{ _smsParams.MessageQueryParamName, message }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user