yangys
2024-03-27 44028c2d1a7f21da831cb07ecb1b4a7873d8627b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
      }
}