将依赖事件总线的发布订阅模式,改为直接调用的形式

This commit is contained in:
yang.lee
2023-11-02 15:58:15 +08:00
parent 02e4dbb45a
commit b13574530d
32 changed files with 226 additions and 154 deletions

View File

@@ -1,4 +1,5 @@
using IGeekFan.AspNetCore.Knife4jUI;
using System.Reflection;
using IGeekFan.AspNetCore.Knife4jUI;
using JNPF.API.Entry.Handlers;
using JNPF.Common.Cache;
using JNPF.Common.Core;
@@ -62,15 +63,14 @@ public class Startup : AppStartup
.AddSenparcWeixinServices(App.Configuration); // Senparc.Weixin 注册如果使用Senparc.Weixin SDK则添加
services.AddOverideVisualDev();
//注册任务消息通知 added by ly on 20230814
//services.AddTaskMessageNotify();
SnowflakeIdHelper.InitYitIdWorker();
//定时任务
//services.AddHostedService<TimedTaskBackgroundService>();
services.AddHostedService<TimedTaskBackgroundService>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider, IOptions<SenparcSetting> senparcSetting, IOptions<SenparcWeixinSetting> senparcWeixinSetting)
{
// 添加状态码拦截中间件
@@ -115,7 +115,7 @@ public class Startup : AppStartup
endpoints.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}");
});
//SnowflakeIdHelper.InitYitIdWorker();
SnowflakeIdHelper.InitYitIdWorker();
bool isStartTimeJob = App.GetConfig<bool>("IsStartTimeJob");
if (isStartTimeJob)