You've already forked FrameTour-BE
支持微信服务通知,调整方法
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ycwl.basic.notify;
|
||||
|
||||
import com.ycwl.basic.notify.adapters.INotifyAdapter;
|
||||
import com.ycwl.basic.notify.adapters.ServerChanNotifyAdapter;
|
||||
import com.ycwl.basic.notify.adapters.WxMpSrvNotifyAdapter;
|
||||
import com.ycwl.basic.notify.enums.NotifyType;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -12,11 +13,18 @@ public class NotifyFactory {
|
||||
switch (type) {
|
||||
case SERVER_CHAN:
|
||||
return new ServerChanNotifyAdapter();
|
||||
case WX_MP_SRV:
|
||||
return new WxMpSrvNotifyAdapter();
|
||||
default:
|
||||
throw new RuntimeException("不支持的通知类型");
|
||||
}
|
||||
}
|
||||
|
||||
public static INotifyAdapter get(NotifyType type, Map<String, String> config) {
|
||||
INotifyAdapter adapter = get(type);
|
||||
adapter.loadConfig(config);
|
||||
return adapter;
|
||||
}
|
||||
|
||||
protected static Map<String, INotifyAdapter> namedNotifier = new HashMap<>();
|
||||
protected static INotifyAdapter defaultNotifier = null;
|
||||
|
Reference in New Issue
Block a user