|
|
@ -1,6 +1,7 @@
|
|
|
|
using Autofac;
|
|
|
|
using Autofac;
|
|
|
|
using Autofac.Extensions.DependencyInjection;
|
|
|
|
using Autofac.Extensions.DependencyInjection;
|
|
|
|
using HybirdFrameworkCore.Autofac;
|
|
|
|
using HybirdFrameworkCore.Autofac;
|
|
|
|
|
|
|
|
using HybirdFrameworkCore.AutoTask;
|
|
|
|
using HybirdFrameworkCore.Configuration;
|
|
|
|
using HybirdFrameworkCore.Configuration;
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
using HybirdFrameworkCore.Redis;
|
|
|
|
using HybirdFrameworkCore.Redis;
|
|
|
@ -53,8 +54,8 @@ builder.Services.AddSwaggerGen(c =>
|
|
|
|
c.IncludeXmlComments(Path.Combine(basePath, "WebStarter.xml"), true);
|
|
|
|
c.IncludeXmlComments(Path.Combine(basePath, "WebStarter.xml"), true);
|
|
|
|
c.IncludeXmlComments(Path.Combine(basePath, "Entity.xml"), true);
|
|
|
|
c.IncludeXmlComments(Path.Combine(basePath, "Entity.xml"), true);
|
|
|
|
c.IncludeXmlComments(Path.Combine(basePath, "HybirdFrameworkCore.xml"), true);
|
|
|
|
c.IncludeXmlComments(Path.Combine(basePath, "HybirdFrameworkCore.xml"), true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddControllers().AddJsonOptions(configure =>
|
|
|
|
builder.Services.AddControllers().AddJsonOptions(configure =>
|
|
|
@ -63,7 +64,7 @@ builder.Services.AddControllers().AddJsonOptions(configure =>
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//redis
|
|
|
|
//redis
|
|
|
|
var redisConnectionString = AppSettingsHelper.GetContent("Redis", "Connection");
|
|
|
|
var redisConnectionString = AppSettingsHelper.GetContent("Redis", "Connection");
|
|
|
|
var instanceName = AppSettingsHelper.GetContent("Redis", "InstanceName");//默认数据库
|
|
|
|
var instanceName = AppSettingsHelper.GetContent("Redis", "InstanceName");//默认数据库
|
|
|
|
var defaultDb = int.Parse(AppSettingsHelper.GetContent("Redis", "DefaultDB") ?? "0");
|
|
|
|
var defaultDb = int.Parse(AppSettingsHelper.GetContent("Redis", "DefaultDB") ?? "0");
|
|
|
|
if (redisConnectionString != null && instanceName != null)
|
|
|
|
if (redisConnectionString != null && instanceName != null)
|
|
|
|
builder.Services.AddSingleton(new RedisHelper(redisConnectionString, instanceName, defaultDb));
|
|
|
|
builder.Services.AddSingleton(new RedisHelper(redisConnectionString, instanceName, defaultDb));
|
|
|
@ -98,4 +99,7 @@ AppInfo.Container = app.Services.GetAutofacRoot();
|
|
|
|
|
|
|
|
|
|
|
|
var listen = builder.Configuration.GetSection("Listen");
|
|
|
|
var listen = builder.Configuration.GetSection("Listen");
|
|
|
|
CarServerMgr.InitServer(int.Parse(listen.GetSection("Port").Value ?? "5588"));
|
|
|
|
CarServerMgr.InitServer(int.Parse(listen.GetSection("Port").Value ?? "5588"));
|
|
|
|
app.Run();
|
|
|
|
|
|
|
|
|
|
|
|
TaskInit.Init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.Run();
|
|
|
|