测试 CultureInfoFilter
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-10-11 18:00:45 +08:00
parent ed61419a6a
commit 79fd83449a
4 changed files with 61 additions and 7 deletions
+5
View File
@@ -35,6 +35,7 @@ using IRaCIS.Core.Application.MassTransit.Command;
using IRaCIS.Core.Application.MassTransit.Consumer;
using DocumentFormat.OpenXml.InkML;
using IRaCIS.Core.Domain;
using MassTransit.Internals;
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
@@ -182,6 +183,10 @@ builder.Services.AddMassTransit(cfg =>
//使用 Hangfire 进行消息调度
cfg.UseHangfireScheduler();
cfg.UseConsumeFilter(typeof(CultureInfoFilter<>), context,
x => x.Include(type => type.HasInterface(typeof(IConsumer<>))));
// 这里可以进行额外的配置
cfg.ConfigureEndpoints(context); // 自动配置所有消费者的端点