using Lada.Framework.Infrastructures.Services;
using Ladaer.BackEnd.Infrastructures.Startup;
using OfficeOpenXml;

var builder = WebApplication.CreateBuilder(args);


builder.Logging.ClearProviders();
builder.Logging.AddConsole();
// Add services to the container.

//builder.Services.AddControllers();
//// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
//builder.Services.AddEndpointsApiExplorer();
//builder.Services.AddSwaggerGen();

builder.Services.RegisterGeneralServices(builder.Configuration);
builder.Services.RegisterSwaggerServices();
builder.Services.RegisterSecurityServices(builder.Configuration);
builder.Services.RegisterDependency(builder.Configuration);

//builder.Services.AddScoped<AuthService>();
builder.Services.AddHttpClient<GoogleMapService>();
//builder.Services.AddScoped<AuthService>();

builder.Services.AddHostedService<StartupHostedService>();

builder.Services.AddHttpContextAccessor();

var app = builder.Build();

// Lấy IAppConfigService từ DI container
//var appConfigService = app.Services.GetRequiredService<IAppConfigService>();

app.ConfigAndRunApp();

