代码修改

This commit is contained in:
he
2025-10-29 09:50:37 +08:00
parent ca679057c4
commit c77b3d74c8
9 changed files with 21617 additions and 103 deletions
@@ -34,7 +34,7 @@ public static class ServiceCollectionSetup
services.Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
//转发头设置 获取真实IP
//תͷ ȡʵIP
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders =
@@ -52,7 +52,7 @@ public static class ServiceCollectionSetup
services.AddScoped<IObtainTaskAutoCancelJob, ObtainTaskAutoCancelJob>();
// 注册以Service 结尾的服务
// עService βķ
services.Scan(scan => scan
.FromAssemblies(typeof(BaseService).Assembly)
.AddClasses(classes => classes.Where(t => t.Name.Contains("Service")))
@@ -71,23 +71,23 @@ public static class ServiceCollectionSetup
#endregion
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
// MediatR Ϣ ¼ ӳ עhandlerӦϵ
//builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
#region
#region ʷ
//builder.Services.AddMemoryCache();
////上传限制 配置
////ϴ
//builder.Services.Configure<FormOptions>(options =>
//{
// options.MultipartBodyLengthLimit = int.MaxValue;
// options.ValueCountLimit = int.MaxValue;
// options.ValueLengthLimit = int.MaxValue;
//});
//IP 限流 可设置白名单 或者黑名单
//IP ð ߺ
//services.AddIpPolicyRateLimitSetup(_configuration);
// 用户类型 策略授权
// û Ȩ
//services.AddAuthorizationPolicySetup(_configuration);
#endregion
}
@@ -95,25 +95,25 @@ public static class ServiceCollectionSetup
}
#region Autofac
#region Autofac
//public class AutofacModuleSetup : Autofac.Module
//{
// protected override void Load(ContainerBuilder containerBuilder)
// {
// #region byzhouhang 20210917 此处注册泛型仓储 可以减少Domain层 和Infra.EFcore 两层 空的仓储接口定义和 仓储文件定义
// #region byzhouhang 20210917 ˴עͲִ ԼDomain Infra.EFcore յIJִӿڶ ִļ
// containerBuilder.RegisterGeneric(typeof(Repository<>))
// .As(typeof(IRepository<>)).InstancePerLifetimeScope();//注册泛型仓储
// .As(typeof(IRepository<>)).InstancePerLifetimeScope();//עͲִ
// containerBuilder.RegisterType<Repository>().As<IRepository>().InstancePerLifetimeScope();
// #endregion
// #region 指定控制器也由autofac 来进行实例获取 https://www.cnblogs.com/xwhqwer/p/15320838.html
// #region ָҲautofac ʵȡ https://www.cnblogs.com/xwhqwer/p/15320838.html
// //获取所有控制器类型并使用属性注入
// //ȡпͲʹע
// containerBuilder.RegisterAssemblyTypes(typeof(BaseService).Assembly)
// .Where(type => typeof(IDynamicWebApi).IsAssignableFrom(type))
// .PropertiesAutowired();
@@ -129,7 +129,7 @@ public static class ServiceCollectionSetup
// //containerBuilder.RegisterType<UserInfo>().As<IUserInfo>().InstancePerLifetimeScope();
// //注册hangfire任务 依赖注入
// //עhangfire ע
// containerBuilder.RegisterType<ObtainTaskAutoCancelJob>().As<IObtainTaskAutoCancelJob>().InstancePerDependency();
// }