add-options:增加飞书配置节

This commit is contained in:
hardstylewyl 2025-06-05 18:04:02 +08:00
parent 0a4103abf5
commit b95be95910

View File

@ -139,7 +139,7 @@ public class SjzyTrackApplicationModule : AbpModule
Console.WriteLine("-- 当前为VS本地环境,用内存存储和内存队列");
}
Action<RabbitOptions> action = options =>
Action<RabbitOptions> action = options =>
{
options.ConnectionString =
$"amqp://{configuration["RabbitMQ:UserName"]}:{configuration["RabbitMQ:Password"]}@{configuration["RabbitMQ:HostName"]}:{configuration["RabbitMQ:Port"]}";
@ -208,6 +208,14 @@ public class SjzyTrackApplicationModule : AbpModule
// 注册预警任务后台服务
context.Services.AddHostedService<WarningTaskComponentBackgroundService>();
// 注册飞书服务(用于预警通知)
context.Services.AddFeishuNetSdk(o =>
{
o.AppId = configuration.GetValue<string>("FeiShu:AppId")!;
o.AppSecret = configuration.GetValue<string>("FeiShu:AppSecret")!;
o.EnableLogging = configuration.GetValue<bool>("FeiShu:EnableLogging");
});
// 注册HangFire服务
context.Services.Configure<TrackWarningTaskOptions>(configuration.GetSection("WarningTask"));
context.Services.AddHangfire(o =>