refactor(Application.Configurations): Config-Suffix in Params umbenannt.

This commit is contained in:
Developer 02 2025-01-31 12:51:44 +01:00
parent 363329ca18
commit 120c8623dd
8 changed files with 24 additions and 29 deletions

View File

@ -1,13 +0,0 @@
namespace EnvelopeGenerator.Application.Configurations
{
public class DispatcherConfig
{
public int SendingProfile { get; init; } = 1;
public string AddedWho { get; init; } = "DDEnvelopGenerator";
public int ReminderTypeId { get; init; } = 202377;
public string EmailAttmt1 { get; init; } = string.Empty;
}
}

View File

@ -0,0 +1,12 @@
namespace EnvelopeGenerator.Application.Configurations;
public class DispatcherParams
{
public int SendingProfile { get; init; } = 1;
public string AddedWho { get; init; } = "DDEnvelopGenerator";
public int ReminderTypeId { get; init; } = 202377;
public string EmailAttmt1 { get; init; } = string.Empty;
}

View File

@ -1,7 +0,0 @@
namespace EnvelopeGenerator.Application.Configurations
{
public class MailConfig
{
public required Dictionary<string, string> Placeholders { get; init; }
}
}

View File

@ -0,0 +1,6 @@
namespace EnvelopeGenerator.Application.Configurations;
public class MailParams
{
public required Dictionary<string, string> Placeholders { get; init; }
}

View File

@ -54,8 +54,8 @@ namespace EnvelopeGenerator.Application.Extensions
services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly); services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly);
services.AddAutoMapper(typeof(UserMappingProfile).Assembly); services.AddAutoMapper(typeof(UserMappingProfile).Assembly);
services.ConfigureByTypeName<DispatcherConfig>(config); services.ConfigureByTypeName<DispatcherParams>(config);
services.ConfigureByTypeName<MailConfig>(config); services.ConfigureByTypeName<MailParams>(config);
services.ConfigureByTypeName<CodeGeneratorParams>(config); services.ConfigureByTypeName<CodeGeneratorParams>(config);
services.ConfigureByTypeName<TotpSmsParams>(config); services.ConfigureByTypeName<TotpSmsParams>(config);

View File

@ -21,12 +21,12 @@ namespace EnvelopeGenerator.Application.Services
{ {
private readonly IEmailTemplateService _tempService; private readonly IEmailTemplateService _tempService;
private readonly IEnvelopeReceiverService _envRcvService; private readonly IEnvelopeReceiverService _envRcvService;
private readonly DispatcherConfig _dConfig; private readonly DispatcherParams _dConfig;
private readonly IConfigService _configService; private readonly IConfigService _configService;
private readonly Dictionary<string, string> _placeholders; private readonly Dictionary<string, string> _placeholders;
private readonly ICodeGenerator _codeGenerator; private readonly ICodeGenerator _codeGenerator;
public EnvelopeMailService(IEmailOutRepository repository, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherConfig> dispatcherConfigOptions, IConfigService configService, IOptions<MailConfig> mailConfig, ICodeGenerator codeGenerator) : base(repository, mapper) public EnvelopeMailService(IEmailOutRepository repository, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherParams> dispatcherConfigOptions, IConfigService configService, IOptions<MailParams> mailConfig, ICodeGenerator codeGenerator) : base(repository, mapper)
{ {
_tempService = tempService; _tempService = tempService;
_envRcvService = envelopeReceiverService; _envRcvService = envelopeReceiverService;

View File

@ -16,7 +16,6 @@ using DigitalData.EmailProfilerDispatcher;
using EnvelopeGenerator.Infrastructure; using EnvelopeGenerator.Infrastructure;
using EnvelopeGenerator.Web.Sanitizers; using EnvelopeGenerator.Web.Sanitizers;
using EnvelopeGenerator.Application.Extensions; using EnvelopeGenerator.Application.Extensions;
using Microsoft.Extensions.DependencyInjection;
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger(); var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
logger.Info("Logging initialized!"); logger.Info("Logging initialized!");
@ -50,8 +49,6 @@ try
// Add higher order services // Add higher order services
builder.Services.AddScoped<EnvelopeOldService>(); builder.Services.AddScoped<EnvelopeOldService>();
builder.Services.Configure<TotpSmsParams>(config.GetSection("TotpSmsParams"));
// Add controllers and razor views // Add controllers and razor views
builder.Services.AddControllersWithViews(options => builder.Services.AddControllersWithViews(options =>
{ {

View File

@ -108,13 +108,13 @@
"ShowPageClass": "dd-show-logo", "ShowPageClass": "dd-show-logo",
"LockedPageClass": "dd-locked-logo" "LockedPageClass": "dd-locked-logo"
}, },
"DispatcherConfig": { "DispatcherParams": {
"SendingProfile": 1, "SendingProfile": 1,
"AddedWho": "DDEnvelopGenerator", "AddedWho": "DDEnvelopGenerator",
"ReminderTypeId": 202377, "ReminderTypeId": 202377,
"EmailAttmt1": "" "EmailAttmt1": ""
}, },
"MailConfig": { "MailParams": {
"Placeholders": { "Placeholders": {
"[NAME_PORTAL]": "signFlow", "[NAME_PORTAL]": "signFlow",
"[SIGNATURE_TYPE]": "signieren", "[SIGNATURE_TYPE]": "signieren",