options:将配置提取到外部
This commit is contained in:
parent
69aa048ae9
commit
b62527f337
@ -263,6 +263,7 @@ public sealed class WarningNotifyAggregator : ITransientDependency
|
||||
|
||||
private List<NotifyConfig> BuildNotifyConfigs(List<WarningNotifyTaskEntity> needNotifyTasks)
|
||||
{
|
||||
var systemId = _optionsMonitor.CurrentValue.MiddleSystemId;
|
||||
var result = new List<NotifyConfig>();
|
||||
if (needNotifyTasks.Count == 0) return result;
|
||||
|
||||
@ -302,11 +303,13 @@ public sealed class WarningNotifyAggregator : ITransientDependency
|
||||
//接收完整预警,命中规则1,通知方式(飞书) ,命中规则2,通知方式(飞书,站内信)
|
||||
//此时聚合后,消息为:总共6条预警消息,其中回传xx条,运输xx条,完整xx条
|
||||
//同时使用飞书和站内信两种方式通知
|
||||
result.Add(NotifyConfig.CreateConfig(userId, notifyMessage, new List<int>
|
||||
var config = NotifyConfig.CreateConfig(userId, notifyMessage, new List<int>
|
||||
{
|
||||
1,
|
||||
2
|
||||
}));
|
||||
});
|
||||
config.SystemId = systemId;
|
||||
result.Add(config);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@ -2,6 +2,11 @@ namespace SJZY.Track.Application.Options;
|
||||
|
||||
public sealed class TrackWarningTaskOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 所属子系统id(业务中台id)
|
||||
/// </summary>
|
||||
public int MiddleSystemId { get; set; }
|
||||
|
||||
/// <summary> 通知任务扫描优先级 </summary>
|
||||
public int ScanWarningNotifyTaskLevel { get; set; }
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user