From c83e4832d893edeb2d0b9d38f2e231abdd5fe687 Mon Sep 17 00:00:00 2001 From: bekodeg Date: Wed, 22 May 2024 09:32:20 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BF=D0=BE=D1=87=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SushiBar/SushiBar/App.config | 10 +++++----- SushiBar/SushiBarClientApi/appsettings.json | 14 +++++++++++++- SushiBar/SushiBarRestApi/Program.cs | 7 ++++++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/SushiBar/SushiBar/App.config b/SushiBar/SushiBar/App.config index 7d2b7c1..5358022 100644 --- a/SushiBar/SushiBar/App.config +++ b/SushiBar/SushiBar/App.config @@ -1,11 +1,11 @@  - - - + + + - - + + \ No newline at end of file diff --git a/SushiBar/SushiBarClientApi/appsettings.json b/SushiBar/SushiBarClientApi/appsettings.json index 5fa563a..86fe7e8 100644 --- a/SushiBar/SushiBarClientApi/appsettings.json +++ b/SushiBar/SushiBarClientApi/appsettings.json @@ -6,5 +6,17 @@ } }, "AllowedHosts": "*", - "IPAddress": "http://localhost:5050" + + "IPAddress": "http://localhost:5050", + + "MailConfigBindingModel": { + "SmtpClientHost": "smtp.yandex.ru", + "SmtpClientPort": 465, + + "PopHost": "pop.yandex.com", + "PopPort": 995, + + "MailLogin": "tester.b.moio@ya.ru", + "MailPassword": "pyzzqswchjevecec" + } } diff --git a/SushiBar/SushiBarRestApi/Program.cs b/SushiBar/SushiBarRestApi/Program.cs index e926907..78db750 100644 --- a/SushiBar/SushiBarRestApi/Program.cs +++ b/SushiBar/SushiBarRestApi/Program.cs @@ -1,7 +1,10 @@ using SushiBarBusinessLogic.BusinessLogics; +using SushiBarBusinessLogic.MailWorker; +using SushiBarContracts.BindingModels; using SushiBarContracts.BusinessLogicsContracts; using SushiBarContracts.StoragesContracts; using SushiBarDatabaseImplement.Implements; +using static Org.BouncyCastle.Math.EC.ECCurve; var builder = WebApplication.CreateBuilder(args); builder.Logging.SetMinimumLevel(LogLevel.Information); @@ -19,9 +22,11 @@ builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); - var app = builder.Build(); +MailConfigBindingModel? mailSender = builder.Configuration.GetSection("MailConfigBindingModel").Get(); +app.Services.GetService()?.MailConfig(mailSender!); + // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) {