wms电梯设定,新增开关电梯控制接口
This commit is contained in:
@@ -20,6 +20,7 @@ namespace JNPF.API.Entry;
|
||||
|
||||
public class Startup : AppStartup
|
||||
{
|
||||
//private TimedTaskBackgroundService timedTaskSvc = new();
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// 注册和配置Mvc和api服务
|
||||
@@ -48,7 +49,7 @@ public class Startup : AppStartup
|
||||
|
||||
services.AddMemoryCache(); // 使用本地缓存必须添加
|
||||
services.AddConfigurableOptions<CacheOptions>();
|
||||
services.AddSingleton( typeof(ISingleton), typeof(RedisData));
|
||||
services.AddSingleton(typeof(ISingleton), typeof(RedisData));
|
||||
// 微信
|
||||
services.AddSenparcGlobalServices(App.Configuration) // Senparc.CO2NET 全局注册
|
||||
.AddSenparcWeixinServices(App.Configuration); // Senparc.Weixin 注册(如果使用Senparc.Weixin SDK则添加)
|
||||
@@ -56,15 +57,18 @@ public class Startup : AppStartup
|
||||
services.AddOverideVisualDev();
|
||||
|
||||
//定时任务
|
||||
services.AddHostedService<TimedTaskBackgroundService>();
|
||||
//services.AddHostedService<RedisBackGround>();
|
||||
|
||||
services.AddHostedService<TimedTaskBackgroundService>();
|
||||
services.AddSingleton<BackgroundService, TimedTaskBackgroundService>(sp => new TimedTaskBackgroundService());
|
||||
//var bgSvc = App.GetRequiredService<BackgroundService>();
|
||||
//bgSvc.StartAsync(CancellationToken.None);
|
||||
//services.AddHostedService<RedisBackGround>();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider, IOptions<SenparcSetting> senparcSetting, IOptions<SenparcWeixinSetting> senparcWeixinSetting)
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider, IOptions<SenparcSetting> senparcSetting, IOptions<SenparcWeixinSetting> senparcWeixinSetting, IHostApplicationLifetime lifeTime)
|
||||
{
|
||||
// 添加状态码拦截中间件
|
||||
app.UseUnifyResultStatusCodes();
|
||||
@@ -113,5 +117,10 @@ public class Startup : AppStartup
|
||||
bool isStartTimeJob = App.GetConfig<bool>("IsStartTimeJob");
|
||||
if (isStartTimeJob)
|
||||
serviceProvider.GetRequiredService<ITimeTaskService>().StartTimerJob();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user