package com.qianwen.smartman.modules.notify.manager;
|
|
import com.qianwen.core.notify.NotifyType;
|
import com.qianwen.core.notify.template.AbstractTemplateManager;
|
import com.qianwen.core.notify.template.TemplateProperties;
|
import com.qianwen.core.notify.template.TemplateProvider;
|
import com.qianwen.core.tool.utils.Func;
|
import com.qianwen.smartman.modules.notify.entity.NotifyTemplateEntity;
|
import com.qianwen.smartman.modules.notify.service.INotifyTemplateService;
|
import org.springframework.beans.BeansException;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
import org.springframework.stereotype.Component;
|
|
@Component
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/manager/DefaultTemplateManager.class */
|
public class DefaultTemplateManager extends AbstractTemplateManager implements BeanPostProcessor {
|
@Autowired
|
private INotifyTemplateService templateService;
|
|
protected TemplateProperties getProperties(NotifyType type, String id) {
|
TemplateProperties result = null;
|
NotifyTemplateEntity templateEntity = (NotifyTemplateEntity) this.templateService.getById(id);
|
if (Func.isNotEmpty(templateEntity)) {
|
result = templateEntity.toTemplateProperties();
|
}
|
return result;
|
}
|
|
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
if (bean instanceof TemplateProvider) {
|
register((TemplateProvider) bean);
|
}
|
return bean;
|
}
|
}
|