package com.qianwen.core.notify.executor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.qianwen.core.notify.notifier.Notifier; import com.qianwen.core.notify.notifier.NotifierManager; import com.qianwen.core.tool.metadata.Values; import com.qianwen.core.tool.utils.Func; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.stereotype.Component; @ConditionalOnBean({NotifierManager.class}) @Component /* loaded from: blade-starter-notify-9.3.0.0-SNAPSHOT.jar:org/springblade/core/notify/executor/NotifyQueueExecutorProvider.class */ public class NotifyQueueExecutorProvider implements NotifyExecutorProvider { private static final Logger log = LoggerFactory.getLogger(NotifyQueueExecutorProvider.class); private final NotifierManager notifierManager; public NotifyQueueExecutorProvider(final NotifierManager notifierManager) { this.notifierManager = notifierManager; } @Override // com.qianwen.core.notify.executor.NotifyExecutorProvider public String getExecutor() { return "notifier"; } @Override // com.qianwen.core.notify.executor.NotifyExecutorProvider public void executeNotify(NotifyExecutionContext context) { RuleNotifierProperties config = context.getConfiguration(); config.validate(); Notifier notifier = this.notifierManager.getNotifier(config.getNotifyType(), config.getNotifierId()); if (Func.isNotEmpty(notifier)) { notifier.send(config.getTemplateId(), context.getContextId(), Values.of(context.getData()), context.getNotifiedParty()); } else { log.warn("通知器[{}-{}]不存在", config.getNotifyType(), config.getNotifierId()); } } }