From 45c56eb2641ac2e69c4d1fc37d31e3179edbae67 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 09 三月 2026 09:30:00 +0800
Subject: [PATCH] config: 更新 TargetAddresses 为数组格式

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs |   43 +++++++++++++++++++++++++------------------
 1 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
index 1b0c26a..32e4349 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -20,13 +20,14 @@
 using WIDESEA_Core.Helper;
 //using WIDESEA_Core.HostedService;
 using WIDESEA_Core.Middlewares;
+using WIDESEA_WMSServer.BackgroundServices;
 using WIDESEA_WMSServer.Filter;
 
 var builder = WebApplication.CreateBuilder(args);
 
 builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory()).ConfigureContainer<ContainerBuilder>(builder =>
 {
-    builder.RegisterModule<AutofacModuleRegister>();//带有接口层的服务注入
+    builder.RegisterModule<AutofacModuleRegister>();//锟斤拷锟叫接口诧拷姆锟斤拷锟阶拷锟�
     builder.RegisterModule<AutofacPropertityModuleReg>();//
 }).ConfigureAppConfiguration((hostingContext, config) =>
 {
@@ -36,17 +37,20 @@
 }); ;
 builder.ConfigureApplication();
 
-//App.ExpDateTime = DateTime.Parse("2025-03-31 00:00:00");//过期时间
+//App.ExpDateTime = DateTime.Parse("2025-03-31 00:00:00");//锟斤拷锟斤拷时锟斤拷
 
-// 2、配置服务
-builder.Services.AddSingleton(new AppSettings(builder.Configuration));//注册
-builder.Services.AddAllOptionRegister();//读取配置文件
-builder.Services.AddMemoryCacheSetup();//缓存
+// 2锟斤拷锟斤拷锟矫凤拷锟斤拷
+builder.Services.AddSingleton(new AppSettings(builder.Configuration));//注锟斤拷
+builder.Services.AddAllOptionRegister();//锟斤拷取锟斤拷锟斤拷锟侥硷拷
+builder.Services.Configure<AutoOutboundTaskOptions>(
+    builder.Configuration.GetSection("AutoOutboundTask"));
+builder.Services.AddMemoryCacheSetup();//锟斤拷锟斤拷
 builder.Services.AddWebSocketSetup();
-builder.Services.AddSqlsugarSetup();//SqlSugar 启动服务
-builder.Services.AddDbSetup();//Db 启动服务
-builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入
-//builder.Services.AddHostedService<PermissionDataHostService>();//数据权限
+builder.Services.AddSqlsugarSetup();//SqlSugar 锟斤拷锟斤拷锟斤拷锟斤拷
+builder.Services.AddDbSetup();//Db 锟斤拷锟斤拷锟斤拷锟斤拷
+builder.Services.AddInitializationHostServiceSetup();//应锟矫筹拷始锟斤拷锟斤拷锟斤拷注锟斤拷
+builder.Services.AddHostedService<AutoOutboundTaskBackgroundService>();
+//builder.Services.AddHostedService<PermissionDataHostService>();//锟斤拷锟斤拷权锟斤拷
 builder.Services.AddAutoMapperSetup();
 
 builder.Services.AddCorsSetup();
@@ -64,9 +68,11 @@
     options.Filters.Add(typeof(ActionExecuteFilter));
 });
 
+builder.Services.AddScoped<HttpClientHelper>();
+
 builder.Services.AddAuthorizationSetup();
 
-builder.Services.AddIpPolicyRateLimitSetup(builder.Configuration);//IPLimit限流 启动服务
+builder.Services.AddIpPolicyRateLimitSetup(builder.Configuration);//IPLimit锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷锟斤拷
 
 builder.Services.AddScoped<UseServiceDIAttribute>();
 
@@ -76,7 +82,7 @@
 
 builder.Services.AddControllers(o =>
 {
-    o.Filters.Add(typeof(GlobalExceptionsFilter));//全局异常
+    o.Filters.Add(typeof(GlobalExceptionsFilter));//全锟斤拷锟届常
 })
 .AddNewtonsoftJson(options =>
 {
@@ -97,22 +103,21 @@
 
 var app = builder.Build();
 
-// 3、配置中间件
-app.UseMiniProfiler();//性能分析器
-app.ConfigureApplication();//配置文件
-app.UseApplicationSetup();//启动配置
+// 3锟斤拷锟斤拷锟斤拷锟叫硷拷锟�
+app.UseMiniProfiler();//锟斤拷锟杰凤拷锟斤拷锟斤拷
+app.ConfigureApplication();//锟斤拷锟斤拷锟侥硷拷
+app.UseApplicationSetup();//锟斤拷锟斤拷锟斤拷锟斤拷
 
 app.UseAllServicesMiddle(builder.Services);
 
 app.UseSession();
 app.UseSwaggerAuthorized();
-app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEA_WMSServer.index.html") ?? throw new Exception("WIDESEA_WMSServer.index.html文件"));
+app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEA_WMSServer.index.html") ?? throw new Exception("WIDESEA_WMSServer.index.html锟侥硷拷"));
 app.UseIpLimitMiddle();
 app.UseApiLogMiddleware();
 //todo
 //app.UseRecordAccessLogsMiddle();
 
-app.UseCors(AppSettings.Get(new string[] { "Cors", "PolicyName" }));
 
 DefaultFilesOptions defaultFilesOptions = new DefaultFilesOptions();
 defaultFilesOptions.DefaultFileNames.Clear();
@@ -131,6 +136,8 @@
 
 app.UseRouting();
 
+app.UseCors(AppSettings.Get(new string[] { "Cors", "PolicyName" }));
+
 app.UseAuthentication();
 app.UseAuthorization();
 

--
Gitblit v1.9.3