69 lines
2.3 KiB
C#
69 lines
2.3 KiB
C#
using HospitalBusinessLogic.BusinessLogics;
|
|
using HospitalBusinessLogic.OfficePackage;
|
|
using HospitalBusinessLogic.OfficePackage.Implements;
|
|
using HospitalContracts.BusinessLogicsContracts;
|
|
using HospitalContracts.StoragesContracts;
|
|
using HospitalDataBaseImplements;
|
|
using HospitalDataBaseImplements.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<IClientStorage, ClientStorage>();
|
|
builder.Services.AddTransient<IKurseStorage, KurseStorage>();
|
|
builder.Services.AddTransient<IIllnessStorage, IllnessStorage>();
|
|
builder.Services.AddTransient<ISymptomsStorage, SymptomsStorage>();
|
|
builder.Services.AddTransient<IMedicinesStorage, MedicinesStorage>();
|
|
builder.Services.AddTransient<IProceduresStorage, ProceduresStorage>();
|
|
builder.Services.AddTransient<IRecipesStorage, RecipesStorage>();
|
|
|
|
builder.Services.AddTransient<IClientLogic, ClientLogic>();
|
|
builder.Services.AddTransient<IIllnessLogic, IllnessLogic>();
|
|
builder.Services.AddTransient<ISymptomsLogic, SymptomsLogic>();
|
|
builder.Services.AddTransient<IMedicinesLogic, MedicinesLogic>();
|
|
builder.Services.AddTransient<IProceduresLogic, ProceduresLogic>();
|
|
builder.Services.AddTransient<IKurseLogic, KurseLogic>();
|
|
builder.Services.AddTransient<IRecipesLogic, RecipesLogic>();
|
|
builder.Services.AddTransient<IReportLogic, ReportLogic>();
|
|
|
|
builder.Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
|
builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
|
builder.Services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
|
|
|
|
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 = "HospitalRestApi",
|
|
Version
|
|
= "v1"
|
|
});
|
|
});
|
|
|
|
|
|
var app = builder.Build();
|
|
LoaderFromXML.LoadSymptoms();
|
|
LoaderFromXML.LoadKurses();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json","HospitalRestApi v1"));
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllers();
|
|
|
|
app.Run(); |