diff --git a/BlacksmithWorkshop/BlacksmithWorkshop.sln b/BlacksmithWorkshop/BlacksmithWorkshop.sln
index fc5a9aa..60beb8a 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshop.sln
+++ b/BlacksmithWorkshop/BlacksmithWorkshop.sln
@@ -17,6 +17,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlacksmithWorkshopFileImple
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlacksmithWorkshopDatabaseImplement", "BlacksmithWorkshopDatebaseImplement\BlacksmithWorkshopDatabaseImplement.csproj", "{2DB15039-1244-4882-BF37-C3FD8C0B7CBB}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlacksmithWorkshopRestAPI", "BlacksmithWorkshopRestAPI\BlacksmithWorkshopRestAPI.csproj", "{B873C1C6-126A-4BB9-A7F7-56F36B1CBD0E}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -51,6 +53,10 @@ Global
{2DB15039-1244-4882-BF37-C3FD8C0B7CBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DB15039-1244-4882-BF37-C3FD8C0B7CBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DB15039-1244-4882-BF37-C3FD8C0B7CBB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B873C1C6-126A-4BB9-A7F7-56F36B1CBD0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B873C1C6-126A-4BB9-A7F7-56F36B1CBD0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B873C1C6-126A-4BB9-A7F7-56F36B1CBD0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B873C1C6-126A-4BB9-A7F7-56F36B1CBD0E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/BlacksmithWorkshopRestAPI.csproj b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/BlacksmithWorkshopRestAPI.csproj
new file mode 100644
index 0000000..cd23edf
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/BlacksmithWorkshopRestAPI.csproj
@@ -0,0 +1,27 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Controllers/ClientController.cs b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Controllers/ClientController.cs
new file mode 100644
index 0000000..9562d34
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Controllers/ClientController.cs
@@ -0,0 +1,65 @@
+using BlacksmithWorkshopContracts.BindingModels;
+using BlacksmithWorkshopContracts.BusinessLogicsContracts;
+using BlacksmithWorkshopContracts.SearchModels;
+using BlacksmithWorkshopContracts.ViewModels;
+using Microsoft.AspNetCore.Mvc;
+
+namespace BlacksmithWorkshopRestAPI.Controllers
+{
+ [Route("api/[controller]/[action]")]
+ [ApiController]
+ public class ClientController : Controller
+ {
+ private readonly ILogger _logger;
+ private readonly IClientLogic _logic;
+ public ClientController(IClientLogic logic, ILogger logger)
+ {
+ _logger = logger;
+ _logic = logic;
+ }
+ [HttpGet]
+ public ClientViewModel? Login(string login, string password)
+ {
+ try
+ {
+ return _logic.ReadElement(new ClientSearchModel
+ {
+ Email = login,
+ Password = password
+ });
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка входа в систему");
+ throw;
+ }
+ }
+ [HttpPost]
+ public void Register(ClientBindingModel model)
+ {
+ try
+ {
+ _logic.Create(model);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка регистрации");
+ throw;
+ }
+ }
+ [HttpPost]
+ public void UpdateData(ClientBindingModel model)
+ {
+ try
+ {
+ _logic.Update(model);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка обновления данных");
+ throw;
+ }
+ }
+
+ }
+}
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Controllers/MainController.cs b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Controllers/MainController.cs
new file mode 100644
index 0000000..250c4ae
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Controllers/MainController.cs
@@ -0,0 +1,84 @@
+using BlacksmithWorkshopContracts.BindingModels;
+using BlacksmithWorkshopContracts.BusinessLogicContracts;
+using BlacksmithWorkshopContracts.SearchModels;
+using BlacksmithWorkshopContracts.ViewModels;
+using DocumentFormat.OpenXml.Office2010.Excel;
+using Microsoft.AspNetCore.Mvc;
+
+namespace BlacksmithWorkshopRestAPI.Controllers
+{
+ [Route("api/[controller]/[action]")]
+ [ApiController]
+ public class MainController : Controller
+ {
+ private readonly ILogger _logger;
+ private readonly IOrderLogic _order;
+ private readonly IManufactureLogic _manufacture;
+ public MainController(ILogger logger, IOrderLogic order, IManufactureLogic manufacture)
+ {
+ _logger = logger;
+ _order = order;
+ _manufacture = manufacture;
+ }
+ [HttpGet]
+ public List? GetManufactureList()
+ {
+ try
+ {
+ return _manufacture.ReadList(null);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка получения списка продуктов");
+ throw;
+ }
+ }
+ [HttpGet]
+ public ManufactureViewModel? GetManufacture(int manufactureId)
+ {
+ try
+ {
+ return _manufacture.ReadElement(new ManufactureSearchModel
+ {
+ Id =
+ manufactureId
+ });
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка получения продукта по id={Id}",
+ manufactureId);
+ throw;
+ }
+ }
+ [HttpGet]
+ public List? GetOrders(int clientId)
+ {
+ try
+ {
+ return _order.ReadList(new OrderSearchModel
+ {
+ ClientId = clientId
+ });
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка получения списка заказов клиента id ={Id}", clientId);
+ throw;
+ }
+ }
+ [HttpPost]
+ public void CreateOrder(OrderBindingModel model)
+ {
+ try
+ {
+ _order.CreateOrder(model);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка создания заказа");
+ throw;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Program.cs
new file mode 100644
index 0000000..dbbaf3f
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Program.cs
@@ -0,0 +1,47 @@
+using BlacksmithWorkshopBusinessLogic.BusinessLogics;
+using BlacksmithWorkShopBusinessLogic.BusinessLogics;
+using BlacksmithWorkshopContracts.BusinessLogicContracts;
+using BlacksmithWorkshopContracts.BusinessLogicsContracts;
+using BlacksmithWorkshopContracts.StoragesContracts;
+using BlacksmithWorkshopDatabaseImplement.Implements;
+using Microsoft.OpenApi.Models;
+
+var builder = WebApplication.CreateBuilder(args);
+
+builder.Logging.SetMinimumLevel(LogLevel.Trace);
+builder.Logging.AddLog4Net("log4net.config");
+
+// Add services to the container.
+
+builder.Services.AddTransient();
+builder.Services.AddTransient();
+builder.Services.AddTransient();
+
+builder.Services.AddTransient();
+builder.Services.AddTransient();
+builder.Services.AddTransient();
+
+builder.Services.AddControllers();
+// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
+builder.Services.AddEndpointsApiExplorer();
+builder.Services.AddSwaggerGen(c =>
+{
+ c.SwaggerDoc("v1", new OpenApiInfo { Title = "BlacksmithWorkshopRestApi", Version = "v1" });
+});
+
+var app = builder.Build();
+
+// Configure the HTTP request pipeline.
+if (app.Environment.IsDevelopment())
+{
+ app.UseSwagger();
+ app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "AbstractShopRestApi v1"));
+}
+
+app.UseHttpsRedirection();
+
+app.UseAuthorization();
+
+app.MapControllers();
+
+app.Run();
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Properties/launchSettings.json b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Properties/launchSettings.json
new file mode 100644
index 0000000..54429d8
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/Properties/launchSettings.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:50387",
+ "sslPort": 44331
+ }
+ },
+ "profiles": {
+ "BlacksmithWorkshopRestAPI": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "applicationUrl": "https://localhost:7195;http://localhost:5182",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/appsettings.Development.json b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/appsettings.Development.json
new file mode 100644
index 0000000..0c208ae
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/appsettings.json b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/appsettings.json
new file mode 100644
index 0000000..10f68b8
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*"
+}
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/log4net.config b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/log4net.config
new file mode 100644
index 0000000..51357b2
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshopRestAPI/log4net.config
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file