diff --git a/src/0-core/HuanMeng.MiaoYu.Code/AppExtend/AppConfigExtendServer.cs b/src/0-core/HuanMeng.MiaoYu.Code/AppExtend/AppConfigExtendServer.cs
new file mode 100644
index 0000000..e45abb2
--- /dev/null
+++ b/src/0-core/HuanMeng.MiaoYu.Code/AppExtend/AppConfigExtendServer.cs
@@ -0,0 +1,31 @@
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HuanMeng.MiaoYu.Code.AppExtend
+{
+ ///
+ ///
+ ///
+ ///
+ ///
+ public class AppConfigExtendServer(IDictionaryInfoServer dictionaryInfoServer, IServiceProvider serviceProvider) : IHostedService
+ {
+ public async Task StartAsync(CancellationToken cancellationToken)
+ {
+ //var x = serviceProvider.CreateScope();
+ //注入数据字典
+ await dictionaryInfoServer.Initialization();
+ }
+
+ public Task StopAsync(CancellationToken cancellationToken)
+ {
+ return Task.CompletedTask;
+ }
+ }
+}
diff --git a/src/0-core/HuanMeng.MiaoYu.Code/AppExtend/AppConfigurationExtend.cs b/src/0-core/HuanMeng.MiaoYu.Code/AppExtend/AppConfigurationExtend.cs
index cf60873..f8da067 100644
--- a/src/0-core/HuanMeng.MiaoYu.Code/AppExtend/AppConfigurationExtend.cs
+++ b/src/0-core/HuanMeng.MiaoYu.Code/AppExtend/AppConfigurationExtend.cs
@@ -100,6 +100,7 @@ namespace HuanMeng.MiaoYu.Code.AppExtend
ConfigurationManager = builder.Configuration;
AppConfigInit(builder.Configuration);
builder.Services.AddScoped();
+ builder.Services.AddHostedService();
return builder;
}
diff --git a/src/0-core/HuanMeng.MiaoYu.Code/SysDictionary/DictionaryInfoExtend.cs b/src/0-core/HuanMeng.MiaoYu.Code/SysDictionary/DictionaryInfoExtend.cs
index 184287a..a59871d 100644
--- a/src/0-core/HuanMeng.MiaoYu.Code/SysDictionary/DictionaryInfoExtend.cs
+++ b/src/0-core/HuanMeng.MiaoYu.Code/SysDictionary/DictionaryInfoExtend.cs
@@ -24,7 +24,7 @@ namespace HuanMeng.MiaoYu.Code.SysDictionary
builder.Services.AddSingleton();
builder.Services.AddScoped();
- builder.Services.AddHostedService();
+ //builder.Services.AddHostedService();
}
@@ -62,21 +62,21 @@ namespace HuanMeng.MiaoYu.Code.SysDictionary
}
- ///
- ///
- ///
- ///
- public class DictionaryInfoExtendServer(IDictionaryInfoServer dictionaryInfoServer) : IHostedService
- {
- public async Task StartAsync(CancellationToken cancellationToken)
- {
- await dictionaryInfoServer.Initialization();
+ /////
+ /////
+ /////
+ /////
+ //public class DictionaryInfoExtendServer(IDictionaryInfoServer dictionaryInfoServer) : IHostedService
+ //{
+ // public async Task StartAsync(CancellationToken cancellationToken)
+ // {
+ // await dictionaryInfoServer.Initialization();
- }
+ // }
- public Task StopAsync(CancellationToken cancellationToken)
- {
- return Task.CompletedTask;
- }
- }
+ // public Task StopAsync(CancellationToken cancellationToken)
+ // {
+ // return Task.CompletedTask;
+ // }
+ //}
}
diff --git a/src/2-api/HuanMeng.MiaoYu.WebApi/Program.cs b/src/2-api/HuanMeng.MiaoYu.WebApi/Program.cs
index 2f32781..277b30b 100644
--- a/src/2-api/HuanMeng.MiaoYu.WebApi/Program.cs
+++ b/src/2-api/HuanMeng.MiaoYu.WebApi/Program.cs
@@ -89,16 +89,8 @@ builder.Services.AddControllers()
#endif
//options.SerializerSettings.Converters.Add()
// 其他配置...
-})
- ;
-// .AddJsonOptions(options =>
-//{
-// //options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.Preserve;
-// //options.JsonSerializerOptions.WriteIndented = true;
-// options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
-// //options.JsonSerializerOptions.PropertyNamingPolicy = null;
-// options.JsonSerializerOptions.Converters.Add(new CustomDateTimeConverter("yyyy-MM-dd HH:mm:ss"));
-//});
+});
+
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(c =>
diff --git a/src/2-api/HuanMeng.MiaoYu.WebPayApi/HuanMeng.MiaoYu.WebPayApi.csproj b/src/2-api/HuanMeng.MiaoYu.WebPayApi/HuanMeng.MiaoYu.WebPayApi.csproj
index 98fb5df..3171938 100644
--- a/src/2-api/HuanMeng.MiaoYu.WebPayApi/HuanMeng.MiaoYu.WebPayApi.csproj
+++ b/src/2-api/HuanMeng.MiaoYu.WebPayApi/HuanMeng.MiaoYu.WebPayApi.csproj
@@ -9,6 +9,9 @@
+
+
+