|
|
|
|
using Autofac;
|
|
|
|
|
using Autofac.Extensions.DependencyInjection;
|
|
|
|
|
using DS.Module.AutofacModule;
|
|
|
|
|
using DS.Module.Core.Middlewares;
|
|
|
|
|
using DS.Module.Core.ServiceExtensions;
|
|
|
|
|
using DS.Module.DjyRulesEngine;
|
|
|
|
|
using DS.Module.Jwt;
|
|
|
|
|
using DS.Module.MultiLanguage;
|
|
|
|
|
using DS.Module.PrintModule;
|
|
|
|
|
using DS.Module.RedisModule;
|
|
|
|
|
using DS.Module.SqlSugar;
|
|
|
|
|
using DS.Module.Swagger;
|
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
|
using NLog.Web;
|
|
|
|
|
using DS.WMS.Core.HangfireJob.Method;
|
|
|
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
var environment = builder.Environment.EnvironmentName;
|
|
|
|
|
Console.WriteLine("<22><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:" + environment);
|
|
|
|
|
//ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
builder.Configuration
|
|
|
|
|
// .SetBasePath(builder.Environment.ContentRootPath)
|
|
|
|
|
.AddJsonFile(path: "appsettings.json", optional: false, reloadOnChange: true)
|
|
|
|
|
// .AddJsonFile(path: $"appsettings.{environment}.json", optional: true, reloadOnChange: true)
|
|
|
|
|
.Build();
|
|
|
|
|
builder.Configuration.AddEnvironmentVariables();
|
|
|
|
|
builder.Logging.AddNLog("nlog.config");
|
|
|
|
|
|
|
|
|
|
//Autofacע<63><D7A2>
|
|
|
|
|
builder.Host
|
|
|
|
|
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
|
|
|
|
.ConfigureContainer<ContainerBuilder>(builder => { builder.RegisterModule(new AutofacModuleRegister()); });
|
|
|
|
|
|
|
|
|
|
builder.Services.AddAppWebInstal();
|
|
|
|
|
builder.Services.AddCorsInstall();
|
|
|
|
|
builder.Services.AddUserModuleInstall(); //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
builder.Services.AddRedisModuleInstall();
|
|
|
|
|
builder.Services.AddSqlSugarInstall();
|
|
|
|
|
builder.Services.AddSwaggerInstall();
|
|
|
|
|
builder.Services.AddJwtInstall();
|
|
|
|
|
builder.Services.AddSaasDbInstall();//<2F>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
builder.Services.AddMultiLanguageInstall();//<2F><><EFBFBD><EFBFBD><EFBFBD>Է<EFBFBD><D4B7><EFBFBD>
|
|
|
|
|
|
|
|
|
|
builder.Services.AddDjyModuleInstall();//Djy<6A><79><EFBFBD><EFBFBD>
|
|
|
|
|
builder.Services.AddRuleEngineModuleInstall();//Djy<6A><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
// builder.Services.AddEndpointsApiExplorer();
|
|
|
|
|
// builder.Services.AddSwaggerGen();
|
|
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
|
|
app.UsePublicMiddlewares();
|
|
|
|
|
|
|
|
|
|
app.UseJobMiddlewares();
|
|
|
|
|
|
|
|
|
|
app.Run();
|