From a1596341546d45a9cf0762344b0c5d5a00a11f62 Mon Sep 17 00:00:00 2001 From: "kagbie3nn@mail.ru" Date: Thu, 30 May 2024 22:14:11 +0400 Subject: [PATCH] api --- git/JurasicZoo/ZooRestApi/Program.cs | 32 +++++++++++++++++++-- git/JurasicZoo/ZooRestApi/ZooRestApi.csproj | 1 + 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/git/JurasicZoo/ZooRestApi/Program.cs b/git/JurasicZoo/ZooRestApi/Program.cs index 48863a6..fda3c32 100644 --- a/git/JurasicZoo/ZooRestApi/Program.cs +++ b/git/JurasicZoo/ZooRestApi/Program.cs @@ -1,11 +1,37 @@ +using Microsoft.OpenApi.Models; +using ZooBusinessLogic.BusinessLogic; +using ZooContracts.BuisnessLogicsContracts; +using ZooContracts.BusinessLogicsContracts; +using ZooContracts.StorageContracts; +using ZooDataBaseImplement.Implements; + 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.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(); +builder.Services.AddSwaggerGen(c => +{ + c.SwaggerDoc("v1", new OpenApiInfo + { + Title = "ComputersShopRestApi", + Version = "v1" + }); +}); var app = builder.Build(); @@ -13,7 +39,7 @@ var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseSwagger(); - app.UseSwaggerUI(); + app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "ComputersShopRestApi v1")); } app.UseHttpsRedirection(); @@ -22,4 +48,4 @@ app.UseAuthorization(); app.MapControllers(); -app.Run(); +app.Run(); \ No newline at end of file diff --git a/git/JurasicZoo/ZooRestApi/ZooRestApi.csproj b/git/JurasicZoo/ZooRestApi/ZooRestApi.csproj index e3bde01..b010f76 100644 --- a/git/JurasicZoo/ZooRestApi/ZooRestApi.csproj +++ b/git/JurasicZoo/ZooRestApi/ZooRestApi.csproj @@ -7,6 +7,7 @@ +