feat(GtxMessagingService): Eingespritzter Client.IHttpClientService
This commit is contained in:
parent
b76ebd2abc
commit
18ef1d19b5
@ -1,12 +1,16 @@
|
|||||||
namespace EnvelopeGenerator.Application.Configurations.GtxMessaging
|
using DigitalData.Core.Abstractions.Client;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Configurations.GtxMessaging
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/
|
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SmsParams
|
public class SmsParams : IHttpClientOptions
|
||||||
{
|
{
|
||||||
//TODO: Add a regex check to init methods to reduce the chance of errors.
|
//TODO: Add a regex check to init methods to reduce the chance of errors.
|
||||||
public required string Endpoint { get; init; } = "https://rest.gtx-messaging.net/smsc/sendsms";
|
public string Uri { get; set; } = "https://rest.gtx-messaging.net";
|
||||||
|
|
||||||
|
public string Path { get; set; } = "smsc/sendsms";
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
public required string AuthKey { get; init; }
|
public required string AuthKey { get; init; }
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
|
using DigitalData.Core.Abstractions.Client;
|
||||||
|
using DigitalData.Core.Client;
|
||||||
|
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Services
|
namespace EnvelopeGenerator.Application.Services
|
||||||
@ -7,9 +9,12 @@ namespace EnvelopeGenerator.Application.Services
|
|||||||
{
|
{
|
||||||
private readonly SmsParams _smsParams;
|
private readonly SmsParams _smsParams;
|
||||||
|
|
||||||
public GtxMessagingService(IOptions<SmsParams> smsParamsOptions)
|
private readonly IHttpClientService<SmsParams> _smsClient;
|
||||||
|
|
||||||
|
public GtxMessagingService(IOptions<SmsParams> smsParamsOptions, HttpClientService<SmsParams> smsClient)
|
||||||
{
|
{
|
||||||
_smsParams = smsParamsOptions.Value;
|
_smsParams = smsParamsOptions.Value;
|
||||||
|
_smsClient = smsClient;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user