yangys
2024-04-05 84dea9976c29ac938fa018b8566c71461b056418
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
27
28
package com.qianwen.core.notify.notifier;
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.qianwen.core.notify.NotifyResultProducer;
import com.qianwen.core.notify.event.NotifierEvent;
import com.qianwen.core.notify.template.Template;
import com.qianwen.core.tool.utils.Func;
 
/* loaded from: blade-starter-notify-9.3.0.0-SNAPSHOT.jar:org/springblade/core/notify/notifier/NotifierEventDispatcher.class */
public class NotifierEventDispatcher<T extends Template> extends NotifierProxy<T> {
    private static final Logger log = LoggerFactory.getLogger(NotifierEventDispatcher.class);
    private final NotifyResultProducer notifyResultProducer;
 
    public NotifierEventDispatcher(NotifyResultProducer notifyResultProducer, Notifier<T> target) {
        super(target);
        this.notifyResultProducer = notifyResultProducer;
    }
 
    @Override // com.qianwen.core.notify.notifier.NotifierProxy
    protected void onEvent(NotifierEvent event) {
        if (Func.isNotEmpty(this.notifyResultProducer)) {
            this.notifyResultProducer.asyncSend(event.toSerializable());
        } else {
            log.error("没有实现消息结果发送生产者");
        }
    }
}