feat(GtxMessagingService): SendSms-Methode initialisiert und Authentifizierungspfad hinzugefügt.

This commit is contained in:
Developer 02 2024-11-22 15:37:59 +01:00
parent 18ef1d19b5
commit 5da306acd3
2 changed files with 13 additions and 2 deletions

View File

@ -50,5 +50,7 @@ namespace EnvelopeGenerator.Application.Configurations.GtxMessaging
public int? Deferred { get; init; }
public DateTime? DeferredTime { get; init; }
internal string AuthPath => Format is null ? AuthKey : string.Join('/', AuthKey, Format);
}
}

View File

@ -1,5 +1,5 @@
using DigitalData.Core.Abstractions.Client;
using DigitalData.Core.Client;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
using Microsoft.Extensions.Options;
@ -11,10 +11,19 @@ namespace EnvelopeGenerator.Application.Services
private readonly IHttpClientService<SmsParams> _smsClient;
public GtxMessagingService(IOptions<SmsParams> smsParamsOptions, HttpClientService<SmsParams> smsClient)
private readonly string _authPath;
public GtxMessagingService(IOptions<SmsParams> smsParamsOptions, IHttpClientService<SmsParams> smsClient)
{
_smsParams = smsParamsOptions.Value;
_smsClient = smsClient;
_authPath = _smsParams.AuthPath;
}
public async Task SendSms()
{
await _smsClient.FetchAsync(path: _authPath);
}
}
}