Removing unnecessary project + mailconfig settings.

This commit is contained in:
Yuee Shiness 2023-05-19 02:42:53 +04:00
parent 2070a1597b
commit 9bd7b98042
4 changed files with 25 additions and 8 deletions

View File

@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33516.290
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreEmployeeApp", "ComputerStoreEmployeeApp.csproj", "{695B79EB-71FD-456D-BFEA-634500FF2ECB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreBusinessLogic", "..\ComputerStoreBusinessLogic\ComputerStoreBusinessLogic.csproj", "{17F8960F-03CB-49D7-B335-931E6BE5F9FF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreContracts", "..\ComputerStoreContracts\ComputerStoreContracts.csproj", "{1C8DB816-F530-4CC3-9F36-F6191FE49C10}"
@ -13,7 +11,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreDataModels", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreDatabaseImplement", "..\ComputerStoreDatabaseImplement\ComputerStoreDatabaseImplement.csproj", "{24D66D03-F9DA-46C0-8C52-F55DDACDE8AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputerStoreRestAPI", "..\ComputerStoreRestAPI\ComputerStoreRestAPI.csproj", "{11E7B5B7-7AF5-4E1E-837F-E6645D3C0EFB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerStoreRestAPI", "..\ComputerStoreRestAPI\ComputerStoreRestAPI.csproj", "{11E7B5B7-7AF5-4E1E-837F-E6645D3C0EFB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -21,10 +19,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{695B79EB-71FD-456D-BFEA-634500FF2ECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{695B79EB-71FD-456D-BFEA-634500FF2ECB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{695B79EB-71FD-456D-BFEA-634500FF2ECB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{695B79EB-71FD-456D-BFEA-634500FF2ECB}.Release|Any CPU.Build.0 = Release|Any CPU
{17F8960F-03CB-49D7-B335-931E6BE5F9FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17F8960F-03CB-49D7-B335-931E6BE5F9FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17F8960F-03CB-49D7-B335-931E6BE5F9FF}.Release|Any CPU.ActiveCfg = Release|Any CPU

View File

@ -11,7 +11,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ComputerStoreBusinessLogic\ComputerStoreBusinessLogic.csproj" />
<ProjectReference Include="..\ComputerStoreContracts\ComputerStoreContracts.csproj" />
<ProjectReference Include="..\ComputerStoreDatabaseImplement\ComputerStoreDatabaseImplement.csproj" />
</ItemGroup>
</Project>

View File

@ -1,4 +1,6 @@
using ComputerStoreBusinessLogic.BusinessLogic;
using ComputerStoreBusinessLogic.MailStuff;
using ComputerStoreContracts.BindingModels;
using ComputerStoreContracts.BusinessLogicContracts;
using ComputerStoreContracts.StorageContracts;
using ComputerStoreDatabaseImplement.Implements;
@ -27,6 +29,8 @@ builder.Services.AddTransient<IConsignmentLogic,ConsignmentLogic>();
builder.Services.AddTransient<IRequestComponentLogic, RequestComponentLogic>();
builder.Services.AddTransient<IRequestLogic, RequestLogic>();
builder.Services.AddSingleton<AbstractMail, MailKit>();
builder.Services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
@ -34,7 +38,17 @@ builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
var mailSender = app.Services.GetService<AbstractMail>();
mailSender?.MailConfig(new MailConfigBindingModel
{
Login = builder.Configuration?.GetSection("MailLogin")?.Value?.ToString() ?? string.Empty,
Password = builder.Configuration?.GetSection("MailPassword")?.Value?.ToString() ?? string.Empty,
SmtpClientHost = builder.Configuration?.GetSection("SmtpClientHost")?.Value?.ToString() ?? string.Empty,
SmtpClientPort = Convert.ToInt32(builder.Configuration?.GetSection("SmtpClientPort")?.Value?.ToString()),
PopHost = builder.Configuration?.GetSection("PopHost")?.Value?.ToString() ?? string.Empty,
PopPort = Convert.ToInt32(builder.Configuration?.GetSection("PopPort")?.Value?.ToString())
});
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{

View File

@ -5,5 +5,12 @@
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"SmtpClientHost": "smtp.rambler.ru",
"SmtpClientPort": "587",
"PopHost": "pop.rambler.ru",
"PopPort": "995",
"MailLogin": "tmpmailforlabs@rambler.ru",
"MailPassword": "0paRVbmA"
}