feat(GtxMessagingService): SendSms-Methode initialisiert und Authentifizierungspfad hinzugefügt.
This commit is contained in:
parent
18ef1d19b5
commit
5da306acd3
@ -50,5 +50,7 @@ namespace EnvelopeGenerator.Application.Configurations.GtxMessaging
|
|||||||
public int? Deferred { get; init; }
|
public int? Deferred { get; init; }
|
||||||
|
|
||||||
public DateTime? DeferredTime { get; init; }
|
public DateTime? DeferredTime { get; init; }
|
||||||
|
|
||||||
|
internal string AuthPath => Format is null ? AuthKey : string.Join('/', AuthKey, Format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.Abstractions.Client;
|
using DigitalData.Core.Abstractions.Client;
|
||||||
using DigitalData.Core.Client;
|
using DigitalData.Core.DTO;
|
||||||
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
|
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
@ -11,10 +11,19 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
|
|
||||||
private readonly IHttpClientService<SmsParams> _smsClient;
|
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;
|
_smsParams = smsParamsOptions.Value;
|
||||||
_smsClient = smsClient;
|
_smsClient = smsClient;
|
||||||
|
|
||||||
|
_authPath = _smsParams.AuthPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SendSms()
|
||||||
|
{
|
||||||
|
await _smsClient.FetchAsync(path: _authPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user