Class HelloMessageHandler
- java.lang.Object
-
- com.foxinmy.weixin4j.handler.MessageHandlerAdapter<com.foxinmy.weixin4j.message.TextMessage>
-
- com.foxinmy.weixin4j.example.server.handler.TextMessageHandler
-
- com.foxinmy.weixin4j.example.server.handler.HelloMessageHandler
-
- All Implemented Interfaces:
com.foxinmy.weixin4j.handler.WeixinMessageHandler
@Component public class HelloMessageHandler extends TextMessageHandler
输入 hello 回复 world- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description HelloMessageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHandle0(com.foxinmy.weixin4j.request.WeixinRequest request, com.foxinmy.weixin4j.message.TextMessage message)
com.foxinmy.weixin4j.response.WeixinResponse
doHandle0(com.foxinmy.weixin4j.message.TextMessage message)
int
weight()
因为HelloMessageHandler和TextMessageHandler都会匹配到文本消息 所以这里需要提高下权重(大于TextMessageHandler就行了) > TextMessageHandler
-
-
-
Method Detail
-
canHandle0
public boolean canHandle0(com.foxinmy.weixin4j.request.WeixinRequest request, com.foxinmy.weixin4j.message.TextMessage message)
- Overrides:
canHandle0
in classcom.foxinmy.weixin4j.handler.MessageHandlerAdapter<com.foxinmy.weixin4j.message.TextMessage>
-
doHandle0
public com.foxinmy.weixin4j.response.WeixinResponse doHandle0(com.foxinmy.weixin4j.message.TextMessage message)
- Overrides:
doHandle0
in classTextMessageHandler
-
weight
public int weight()
因为HelloMessageHandler和TextMessageHandler都会匹配到文本消息 所以这里需要提高下权重(大于TextMessageHandler就行了) > TextMessageHandler- Specified by:
weight
in interfacecom.foxinmy.weixin4j.handler.WeixinMessageHandler
- Overrides:
weight
in classcom.foxinmy.weixin4j.handler.MessageHandlerAdapter<com.foxinmy.weixin4j.message.TextMessage>
-
-