perf: 优化全部模块程序集
This commit is contained in:
@@ -3,19 +3,17 @@ using Yi.Framework.Core.Autofac.Extensions;
|
||||
using Yi.Framework.Core.Autofac.Modules;
|
||||
using Yi.Framework.Core.Extensions;
|
||||
using Yi.BBS.Web;
|
||||
using Yi.BBS.Application;
|
||||
using Yi.RBAC.Application;
|
||||
using Yi.Framework.Core.Module;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.WebHost.UseStartUrlsServer(builder.Configuration);
|
||||
|
||||
builder.UseYiModules(typeof(YiBBSWebModule));
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>autofacģ<63><C4A3>,<2C><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
builder.Host.ConfigureAutoFacContainer(container =>
|
||||
{
|
||||
container.RegisterYiModule(AutoFacModuleEnum.PropertiesAutowiredModule,
|
||||
typeof(YiBBSApplicationModule).Assembly,
|
||||
typeof(YiRBACApplicationModule).Assembly);
|
||||
container.RegisterYiModule(AutoFacModuleEnum.PropertiesAutowiredModule, ModuleAssembly.Assemblies);
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -11,6 +11,7 @@ using Yi.RBAC.Application;
|
||||
using Yi.Framework.AspNetCore;
|
||||
using Yi.Framework.Data.Json;
|
||||
using Yi.Framework.OperLogManager;
|
||||
using Yi.Framework.Core.Module;
|
||||
|
||||
namespace Yi.BBS.Web
|
||||
{
|
||||
@@ -28,10 +29,11 @@ namespace Yi.BBS.Web
|
||||
services.AddControllers().AddJsonOptions(opt => {
|
||||
opt.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||
});
|
||||
|
||||
services.AddAutoApiService(opt =>
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
opt.CreateConventional(typeof(YiBBSApplicationModule).Assembly, option => option.RootPath = string.Empty);
|
||||
opt.CreateConventional(ModuleAssembly.Assemblies, option => option.RootPath = string.Empty);
|
||||
});
|
||||
|
||||
//添加swagger
|
||||
|
||||
Reference in New Issue
Block a user