Class CustomMessageHandler
- java.lang.Object
-
- com.foxinmy.weixin4j.example.server.handler.CustomMessageHandler
-
- All Implemented Interfaces:
WeixinMessageHandler
public class CustomMessageHandler extends Object implements WeixinMessageHandler
自定义处理消息- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description CustomMessageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHandle(WeixinRequest request, WeixinMessage message, Set<String> nodeNames)
能否处理请求WeixinResponse
doHandle(WeixinRequest request, WeixinMessage messager)
处理请求int
weight()
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高
-
-
-
Method Detail
-
canHandle
public boolean canHandle(WeixinRequest request, WeixinMessage message, Set<String> nodeNames)
Description copied from interface:WeixinMessageHandler
能否处理请求- Specified by:
canHandle
in interfaceWeixinMessageHandler
- Parameters:
request
- 微信请求message
- 微信消息nodeNames
- 节点名称集合- Returns:
- true则执行doHandle
-
doHandle
public WeixinResponse doHandle(WeixinRequest request, WeixinMessage messager)
Description copied from interface:WeixinMessageHandler
处理请求- Specified by:
doHandle
in interfaceWeixinMessageHandler
- Parameters:
request
- 微信请求messager
- 微信消息- Returns:
- 回复内容
-
weight
public int weight()
Description copied from interface:WeixinMessageHandler
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高- Specified by:
weight
in interfaceWeixinMessageHandler
- Returns:
- 权重
-
-