huangxiaoqiang
昨天 843cc2ea1b104ecdf9da61318a4136a5d4096411
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -1,32 +1,35 @@
using WIDESEA_Core.Helper;
using WIDESEA_Core.Extensions;
using WIDESEA_Core.Middlewares;
using System.Reflection;
using WIDESEA_Core.Filter;
using Autofac;
using Autofac.Core;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.OpenApi.Models;
using NewLife.Windows;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;
using System.Text;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using Autofac.Extensions.DependencyInjection;
using Autofac;
using WIDESEA_WMSServer.Filter;
using WIDESEA_Core.Authorization;
using WIDESEA_Core.Core;
using Swashbuckle.AspNetCore.SwaggerGen;
using Microsoft.OpenApi.Models;
using WIDESEA_StorageTaskServices;
using Autofac.Core;
using WIDESEA_Cache;
using Quartz.Spi;
using SimpleRedis;
using WIDESEA_DTO.WMS;
using static NewLife.Remoting.ApiHttpClient;
using NewLife.Windows;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Reflection;
using System.Text;
using WIDESEA.QuartzJob;
using WIDESEA_Cache;
using WIDESEA_Core;
using WIDESEA_Core.Authorization;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Core;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Extensions;
using WIDESEA_Core.Filter;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Middlewares;
using WIDESEA_DTO.WMS;
using WIDESEA_StorageTaskServices;
using WIDESEA_Tasks;
using WIDESEA_WMSServer.Filter;
using static NewLife.Remoting.ApiHttpClient;
var builder = WebApplication.CreateBuilder(args);
@@ -119,6 +122,13 @@
builder.Services.AddHostedService<MyBackgroundService>();
//builder.Services.AddSingleton<IJobFactory, JobFactory>();
//builder.Services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>();
//builder.Services.AddTransient<OutNGTask>();//Job使用瞬时依赖注入
//缓存设置配置转实体
builder.Services.AddConfigurableOptions<CacheSettingsOptions>();
//禁止在主机启动时通过 App.GetOptions<TOptions> 获取选项,如需获取配置选项理应通过 App.GetConfig<TOptions>("配置节点", true)。
@@ -154,6 +164,7 @@
        WIDESEA_Core.Helper.ConsoleHelper.WriteSuccessLine("Redis 服务已成功注册");
    }
}
app.UseQuartzJobMildd();
// 3、配置中间件
app.UseMiniProfiler();//性能分析器