From 037ebfbe5cade81b910d8bd039167e1a3b68b7c2 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 27 May 2024 11:39:02 +0200 Subject: [PATCH] =?UTF-8?q?Schrieb=20die=20Schnittstellen=20des=20Envelope?= =?UTF-8?q?=20Mail=20Service=20f=C3=BCr=20das=20Senden=20und=20Senden=20vo?= =?UTF-8?q?n=20Zugangscode-Mails=20und=20injizierte=20Speicher-Cache.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Contracts/IEnvelopeMailService.cs | 7 +++++- .../Services/EnvelopeMailService.cs | 23 ++++++++++++++++++- EnvelopeGenerator.Web/Program.cs | 2 ++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.Application/Contracts/IEnvelopeMailService.cs b/EnvelopeGenerator.Application/Contracts/IEnvelopeMailService.cs index 56d65cb6..7495f268 100644 --- a/EnvelopeGenerator.Application/Contracts/IEnvelopeMailService.cs +++ b/EnvelopeGenerator.Application/Contracts/IEnvelopeMailService.cs @@ -1,8 +1,13 @@ -using DigitalData.EmailProfilerDispatcher.Application.Contracts; +using DigitalData.Core.DTO; +using DigitalData.EmailProfilerDispatcher.Application.Contracts; +using EnvelopeGenerator.Application.DTOs; +using EnvelopeGenerator.Common; namespace EnvelopeGenerator.Application.Contracts { public interface IEnvelopeMailService : IEmailOutService { + Task> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType); + Task> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto); } } diff --git a/EnvelopeGenerator.Application/Services/EnvelopeMailService.cs b/EnvelopeGenerator.Application/Services/EnvelopeMailService.cs index 14841ffa..ba4fc73c 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeMailService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeMailService.cs @@ -1,15 +1,36 @@ using AutoMapper; +using DigitalData.Core.DTO; +using DigitalData.EmailProfilerDispatcher.Application.DTOs.EmailOut; using DigitalData.EmailProfilerDispatcher.Application.Services; using DigitalData.EmailProfilerDispatcher.Infrastructure.Contracts; using DigitalData.UserManager.Application; using EnvelopeGenerator.Application.Contracts; +using EnvelopeGenerator.Application.DTOs; +using EnvelopeGenerator.Common; +using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Localization; + namespace EnvelopeGenerator.Application.Services { public class EnvelopeMailService : EmailOutService, IEnvelopeMailService { - public EnvelopeMailService(IEmailOutRepository repository, IStringLocalizer localizer, IMapper mapper, IEmailTemplateService tempService) : base(repository, localizer, mapper) + private readonly IEmailTemplateService _tempService; + private readonly IMemoryCache _cache; + + public EnvelopeMailService(IEmailOutRepository repository, IStringLocalizer localizer, IMapper mapper, IEmailTemplateService tempService, IMemoryCache cache) : base(repository, localizer, mapper) { + _tempService = tempService; + _cache = cache; + } + + public Task> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto) + { + throw new NotImplementedException(); + } + + public Task> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType) + { + throw new NotImplementedException(); } } } \ No newline at end of file diff --git a/EnvelopeGenerator.Web/Program.cs b/EnvelopeGenerator.Web/Program.cs index 165a28d9..bb73c019 100644 --- a/EnvelopeGenerator.Web/Program.cs +++ b/EnvelopeGenerator.Web/Program.cs @@ -176,6 +176,8 @@ try builder.Services.AddScoped(); builder.Services.AddDispatcher(); + builder.Services.AddMemoryCache(); + var app = builder.Build(); // Configure the HTTP request pipeline.