You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.1 KiB
C#
63 lines
2.1 KiB
C#
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.QuartzModuleInstall;
|
|
using DS.Module.RedisModule;
|
|
using DS.Module.SqlSugar;
|
|
using DS.Module.Swagger;
|
|
using DS.Module.UserModule;
|
|
using NLog.Web;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
var environment = builder.Environment.EnvironmentName;
|
|
Console.WriteLine("当前环境:" + environment);
|
|
//注册配置
|
|
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注入
|
|
builder.Host
|
|
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
|
.ConfigureContainer<ContainerBuilder>(builder => { builder.RegisterModule(new AutofacModuleRegister()); });
|
|
|
|
builder.Services.AddAppWebInstal();
|
|
builder.Services.AddCorsInstall();
|
|
builder.Services.AddUserModuleInstall(); //用户服务
|
|
builder.Services.AddRedisModuleInstall();
|
|
builder.Services.AddSqlSugarInstall();
|
|
builder.Services.AddSwaggerInstall();
|
|
builder.Services.AddJwtInstall();
|
|
builder.Services.AddSaasDbInstall();//分库服务
|
|
builder.Services.AddMultiLanguageInstall();//多语言服务
|
|
|
|
builder.Services.AddDjyModuleInstall();//Djy服务
|
|
builder.Services.AddRuleEngineModuleInstall();//Djy规则引擎校验服务
|
|
|
|
//builder.Services.AddHangfireFeeInstall();//Hangfire服务
|
|
|
|
// 使用自定义的 Quartz 配置// 添加 Quartz 服务
|
|
builder.Services.AddFeeQuartzModuleInstall(builder.Configuration);
|
|
// builder.Services.AddEndpointsApiExplorer();
|
|
// builder.Services.AddSwaggerGen();
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UsePublicMiddlewares();
|
|
|
|
//app.UseHangfireServer();
|
|
//app.UseJobMiddlewares();
|
|
//JobMiddleware.RegisterJob<IFeeCustTemplateJobService>(j => j.GenerateFeesAsync(), Cron.Daily(23, 30));
|
|
|
|
|
|
app.Run(); |