本文整理汇总了Java中org.hamster.weixinmp.service.handler.WxMessageHandlerIfc类的典型用法代码示例。如果您正苦于以下问题:Java WxMessageHandlerIfc类的具体用法?Java WxMessageHandlerIfc怎么用?Java WxMessageHandlerIfc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WxMessageHandlerIfc类属于org.hamster.weixinmp.service.handler包,在下文中一共展示了WxMessageHandlerIfc类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMessage
import org.hamster.weixinmp.service.handler.WxMessageHandlerIfc; //导入依赖的package包/类
public WxBaseRespEntity handleMessage(WxBaseMsgEntity msg) {
List<WxMessageHandlerIfc> handlerList = new ArrayList<WxMessageHandlerIfc>();
handlerList.addAll(handlers);
Collections.sort(handlerList, new WxMessageHandlerComparator());
Map<String, Object> context = new HashMap<String, Object>();
WxBaseRespEntity result = null;
for (WxMessageHandlerIfc handler : handlerList) {
result = handler.handle(msg, context);
}
if (result == null) {
result = defaultResult(msg.getToUserName(), msg.getFromUserName());
}
return result;
}
示例2: handleMessage
import org.hamster.weixinmp.service.handler.WxMessageHandlerIfc; //导入依赖的package包/类
public WxBaseRespEntity handleMessage(WxBaseMsgEntity msg) {
List<WxMessageHandlerIfc> handlerList = new ArrayList<WxMessageHandlerIfc>();
if(handlers!=null){
handlerList.addAll(handlers);
}
Collections.sort(handlerList, new WxMessageHandlerComparator());
Map<String, Object> context = new HashMap<String, Object>();
WxBaseRespEntity result = null;
for (WxMessageHandlerIfc handler : handlerList) {
result = handler.handle(msg, context);
}
if (result == null) {
result = defaultResult(msg.getToUserName(), msg.getFromUserName());
}
return result;
}
示例3: compare
import org.hamster.weixinmp.service.handler.WxMessageHandlerIfc; //导入依赖的package包/类
public int compare(WxMessageHandlerIfc o1, WxMessageHandlerIfc o2) {
if (o1.priority() > o2.priority()) {
return -1;
} else if (o1.priority() < o2.priority()) {
return 1;
} else {
return 0;
}
}