|
|
@ -15,6 +15,7 @@ using Microsoft.IdentityModel.Tokens;
|
|
|
|
using Service.Cloud.Client;
|
|
|
|
using Service.Cloud.Client;
|
|
|
|
using Service.Execute;
|
|
|
|
using Service.Execute;
|
|
|
|
using Service.Plc.Client;
|
|
|
|
using Service.Plc.Client;
|
|
|
|
|
|
|
|
using Service.RealTime;
|
|
|
|
using SqlSugar;
|
|
|
|
using SqlSugar;
|
|
|
|
using SqlSugar.IOC;
|
|
|
|
using SqlSugar.IOC;
|
|
|
|
|
|
|
|
|
|
|
@ -97,10 +98,16 @@ builder.Services.AddSwaggerGen(c =>
|
|
|
|
c.IncludeXmlComments(Path.Combine(basePath, "HybirdFrameworkCore.xml"), true);
|
|
|
|
c.IncludeXmlComments(Path.Combine(basePath, "HybirdFrameworkCore.xml"), true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddControllers().AddJsonOptions(configure =>
|
|
|
|
bool.TryParse(AppSettingsHelper.GetContent("SignalR", "Enabled"), out var signalrEnabled);
|
|
|
|
|
|
|
|
if (signalrEnabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
configure.JsonSerializerOptions.Converters.Add(new DatetimeJsonConverter());
|
|
|
|
builder.Services.AddSignalR(options =>
|
|
|
|
});
|
|
|
|
{
|
|
|
|
|
|
|
|
options.EnableDetailedErrors = true;
|
|
|
|
|
|
|
|
options.KeepAliveInterval = TimeSpan.FromMinutes(1);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 添加jwt验证
|
|
|
|
// 添加jwt验证
|
|
|
@ -135,6 +142,10 @@ app.UseStaticFiles();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.UseCors("myCors");
|
|
|
|
app.UseCors("myCors");
|
|
|
|
app.MapControllers();
|
|
|
|
app.MapControllers();
|
|
|
|
|
|
|
|
if (signalrEnabled)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
app.MapHub<MyHub>("/realtime");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var list = AppSettingsHelper.GetContent("Kestrel", "Endpoints", "http", "Url");
|
|
|
|
var list = AppSettingsHelper.GetContent("Kestrel", "Endpoints", "http", "Url");
|
|
|
|
foreach (var s in list.Split(";"))
|
|
|
|
foreach (var s in list.Split(";"))
|
|
|
@ -164,7 +175,6 @@ if (AppSettingsHelper.GetBool("swap", "enable"))
|
|
|
|
StationSoftMgr.SwappingStateMachineStart();
|
|
|
|
StationSoftMgr.SwappingStateMachineStart();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TaskInit.Init();
|
|
|
|
TaskInit.Init();
|
|
|
|
|
|
|
|
|
|
|
|
QuartzSchedulerFactory.Init();
|
|
|
|
QuartzSchedulerFactory.Init();
|
|
|
|