1.0.4
This commit is contained in:
parent
6cbe7b971c
commit
55775cc590
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
pre_commit.ps1
|
||||
pre_commit.log
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
|
@ -1,4 +1,12 @@
|
||||
using System.Reflection;
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
using APP_LOGGING.Services.AppLoggingService;
|
||||
using APP_LOGGING.Services.AppLoggingService.Implements;
|
||||
|
@ -1,4 +1,12 @@
|
||||
namespace APP_LOGGING.Services.AppLoggingService;
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
namespace APP_LOGGING.Services.AppLoggingService;
|
||||
|
||||
/// <summary>
|
||||
/// Интерфейс логирования
|
||||
|
@ -1,4 +1,12 @@
|
||||
using System.Text;
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
using System.Text;
|
||||
|
||||
using APP_LOGGING.Accessories.LoggingAccessories;
|
||||
using APP_LOGGING.Services.AppLoggingService;
|
||||
|
@ -1,4 +1,12 @@
|
||||
using System.Text.Json;
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Web.Mvc;
|
||||
|
||||
|
@ -1,4 +1,12 @@
|
||||
namespace APP_UTILITIES.FormatsData.AppEnumsData;
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
namespace APP_UTILITIES.FormatsData.AppEnumsData;
|
||||
|
||||
/// <summary>
|
||||
/// Перечисление на чьей стороне возникла ошибка
|
||||
|
@ -1,4 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace APP_UTILITIES.FormatsData.AppResponseData.BadResponses;
|
||||
|
||||
|
@ -1,4 +1,12 @@
|
||||
using APP_LOGGING.Accessories.LoggingAccessories;
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
using APP_LOGGING.Accessories.LoggingAccessories;
|
||||
|
||||
using Microsoft.AspNetCore.Antiforgery;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
@ -1,3 +1,11 @@
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using AppWeb.Models;
|
||||
@ -5,23 +13,23 @@ using AppWeb.Models;
|
||||
namespace AppWeb.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Главный контроллер
|
||||
/// Главный контроллер
|
||||
/// </summary>
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly ILogger<HomeController> _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор
|
||||
/// Конструктор
|
||||
/// </summary>
|
||||
/// <param name="logger">Логирование MVC</param>
|
||||
/// <param name="logger">Логирование MVC</param>
|
||||
public HomeController(ILogger<HomeController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Главная
|
||||
/// Главная
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
[Route("/")]
|
||||
@ -31,7 +39,7 @@ namespace AppWeb.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Контакты
|
||||
/// Контакты
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
[Route("/contacts")]
|
||||
@ -41,7 +49,7 @@ namespace AppWeb.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ошибка
|
||||
/// Ошибка
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
[Route("/error")]
|
||||
|
@ -1,3 +1,11 @@
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
namespace AppWeb.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
|
@ -1,3 +1,11 @@
|
||||
/*
|
||||
* Author: Nikolay Dvurechensky
|
||||
* Site: https://www.dvurechensky.pro/
|
||||
* Gmail: dvurechenskysoft@gmail.com
|
||||
* Last Updated: 12 мая 2025 06:05:33
|
||||
* Version: 1.0.5
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
@ -17,20 +25,20 @@ builder.WebHost.UseUrls($"https://{builder.Configuration["appSettings:appHost"]}
|
||||
|
||||
builder.Services.AddControllersWithViews();
|
||||
|
||||
#region В этом регионе объявляем сервисы
|
||||
#region В этом регионе объявляем сервисы
|
||||
|
||||
// Например
|
||||
// Например
|
||||
// builder.Services.AddSingleton<ICashService, CashService>();
|
||||
|
||||
#endregion
|
||||
|
||||
builder.Services.Configure<JsonOptions>(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.WriteIndented = true; //для красивого форматирования
|
||||
options.JsonSerializerOptions.WriteIndented = true; //для красивого форматирования
|
||||
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
|
||||
});
|
||||
|
||||
//настройки службы против подделки запросов
|
||||
//настройки службы против подделки запросов
|
||||
builder.Services.AddAntiforgery(options =>
|
||||
{
|
||||
options.HeaderName = "X-CSRF-TOKEN";
|
||||
@ -42,7 +50,7 @@ builder.Services.AddSwaggerGen(options =>
|
||||
{
|
||||
Title = "App API",
|
||||
Version = "1.0.0",
|
||||
Description = "Информация об API",
|
||||
Description = "Информация об API",
|
||||
Contact = new OpenApiContact
|
||||
{
|
||||
Name = "Dvurechensky"
|
||||
@ -58,13 +66,13 @@ var app = builder.Build();
|
||||
var appLifetime = app.Services.GetRequiredService<IHostApplicationLifetime>();
|
||||
|
||||
appLifetime.ApplicationStarted.Register(async () =>
|
||||
{ //инициализируем сервис логирования
|
||||
{ //инициализируем сервис логирования
|
||||
LoggingExtensions.Logging.InitializeLogging("API Reagent Project Control");
|
||||
});
|
||||
|
||||
appLifetime.ApplicationStopping.Register(() =>
|
||||
{
|
||||
LoggingExtensions.Logging.DeinitializeLogging(); //выключаем сервис логирования
|
||||
LoggingExtensions.Logging.DeinitializeLogging(); //выключаем сервис логирования
|
||||
});
|
||||
|
||||
if (!app.Environment.IsDevelopment())
|
||||
@ -77,20 +85,20 @@ else
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Документация");
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Документация");
|
||||
c.RoutePrefix = "docs";
|
||||
});
|
||||
app.UseDeveloperExceptionPage(); //используем страницу исключений
|
||||
app.UseDeveloperExceptionPage(); //используем страницу исключений
|
||||
}
|
||||
|
||||
app.UseCookiePolicy(); //использовать политику куки
|
||||
app.UseCookiePolicy(); //использовать политику куки
|
||||
|
||||
// app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseRouting();
|
||||
|
||||
app.UseMiddleware<AntiforgeryMiddleware>(); //обработчик службы против подделки запросов
|
||||
app.UseMiddleware<AntiforgeryMiddleware>(); //обработчик службы против подделки запросов
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllerRoute(
|
||||
|
Loading…
Reference in New Issue
Block a user