package com.qianwen.core.notify.notifier;
|
|
import java.util.List;
|
import java.util.Optional;
|
import javax.annotation.Nonnull;
|
import com.qianwen.core.notify.template.Template;
|
import com.qianwen.core.notify.template.TemplateManager;
|
import com.qianwen.core.tool.metadata.Values;
|
|
/* loaded from: blade-starter-notify-9.3.0.0-SNAPSHOT.jar:org/springblade/core/notify/notifier/AbstractNotifier.class */
|
public abstract class AbstractNotifier<T extends Template> implements Notifier<T> {
|
private TemplateManager templateManager;
|
|
public AbstractNotifier() {
|
}
|
|
public AbstractNotifier(final TemplateManager templateManager) {
|
this.templateManager = templateManager;
|
}
|
|
@Override
|
public void send(@Nonnull String templateId, @Nonnull String traceId, @Nonnull Values context, List<String> notifiedParty) {
|
Template template = (Template)Optional.<Template>ofNullable(this.templateManager.getTemplate(getType(), templateId)).orElseThrow(() -> new UnsupportedOperationException("模版不存在:" + templateId));
|
send((T)template, traceId, context, notifiedParty);
|
}
|
}
|