renamed(SmsParams): umbenannt in GtxMessagingParams
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
using DigitalData.Core.Abstractions.Client;
|
||||
namespace EnvelopeGenerator.Application.Configurations.GtxMessaging
|
||||
{
|
||||
/// <summary>
|
||||
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/
|
||||
/// </summary>
|
||||
public class SmsParams : IHttpClientOptions
|
||||
{
|
||||
public required string Uri { get; init; }
|
||||
|
||||
public string? Path { get; init; }
|
||||
|
||||
public Dictionary<string, object>? Headers { get; init; }
|
||||
|
||||
public Dictionary<string, object?>? QueryParams { get; init; }
|
||||
|
||||
public string RecipientQueryParamName { get; init; } = "to";
|
||||
|
||||
public string MessageQueryParamName { get; init; } = "text";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using DigitalData.Core.Abstractions.Client;
|
||||
namespace EnvelopeGenerator.Application.Configurations;
|
||||
|
||||
/// <summary>
|
||||
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/
|
||||
/// </summary>
|
||||
public class GtxMessagingParams : IHttpClientOptions
|
||||
{
|
||||
public required string Uri { get; init; }
|
||||
|
||||
public string? Path { get; init; }
|
||||
|
||||
public Dictionary<string, object>? Headers { get; init; }
|
||||
|
||||
public Dictionary<string, object?>? QueryParams { get; init; }
|
||||
|
||||
public string RecipientQueryParamName { get; init; } = "to";
|
||||
|
||||
public string MessageQueryParamName { get; init; } = "text";
|
||||
}
|
||||
@@ -9,7 +9,6 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using DigitalData.Core.Client;
|
||||
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
|
||||
using QRCoder;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Extensions
|
||||
@@ -59,7 +58,7 @@ namespace EnvelopeGenerator.Application.Extensions
|
||||
services.ConfigureByTypeName<CodeGeneratorParams>(config);
|
||||
services.ConfigureByTypeName<TotpSmsParams>(config);
|
||||
|
||||
services.AddHttpClientService<SmsParams>(config.GetSection(nameof(SmsParams)));
|
||||
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
|
||||
services.TryAddSingleton<ISmsSender, GTXSmsSender>();
|
||||
services.TryAddSingleton<IEnvelopeSmsService, EnvelopeSmsService>();
|
||||
services.TryAddSingleton<ICodeGenerator, CodeGenerator>();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Abstractions.Client;
|
||||
using DigitalData.Core.Client;
|
||||
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
|
||||
using EnvelopeGenerator.Application.Configurations;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs.Messaging;
|
||||
using Microsoft.Extensions.Options;
|
||||
@@ -11,15 +11,15 @@ namespace EnvelopeGenerator.Application.Services;
|
||||
//TODO: move to DigitalData.Core
|
||||
public class GTXSmsSender : ISmsSender
|
||||
{
|
||||
private readonly IHttpClientService<SmsParams> _smsClient;
|
||||
private readonly IHttpClientService<GtxMessagingParams> _smsClient;
|
||||
|
||||
private readonly SmsParams _smsParams;
|
||||
private readonly GtxMessagingParams _smsParams;
|
||||
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public string ServiceProvider { get; }
|
||||
|
||||
public GTXSmsSender(IHttpClientService<SmsParams> smsClient, IOptions<SmsParams> smsParamsOptions, IMapper mapper)
|
||||
public GTXSmsSender(IHttpClientService<GtxMessagingParams> smsClient, IOptions<GtxMessagingParams> smsParamsOptions, IMapper mapper)
|
||||
{
|
||||
_smsClient = smsClient;
|
||||
_smsParams = smsParamsOptions.Value;
|
||||
|
||||
@@ -121,10 +121,7 @@
|
||||
"[REASON]": ""
|
||||
}
|
||||
},
|
||||
"GTXMessagingConfig": {
|
||||
"AuthKey": "ep$?A!Gs"
|
||||
},
|
||||
"SmsParams": {
|
||||
"GtxMessagingParams": {
|
||||
"Uri": "https://rest.gtx-messaging.net",
|
||||
"Path": "smsc/sendsms/f566f7e5-bdf2-4a9a-bf52-ed88215a432e/json",
|
||||
"Headers": {},
|
||||
|
||||
Reference in New Issue
Block a user