本文整理匯總了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;
}
}