1 package com.foxinmy.weixin4j.example.server.handler;
2
3 import org.springframework.stereotype.Component;
4
5 import com.foxinmy.weixin4j.handler.MessageHandlerAdapter;
6 import com.foxinmy.weixin4j.message.TextMessage;
7 import com.foxinmy.weixin4j.request.WeixinRequest;
8 import com.foxinmy.weixin4j.response.TextResponse;
9 import com.foxinmy.weixin4j.response.WeixinResponse;
10
11
12
13
14
15
16
17
18
19 @Component
20 public class TextMessageHandler extends MessageHandlerAdapter<TextMessage> {
21 @Override
22 public WeixinResponse doHandle0(TextMessage message) {
23 return new TextResponse("收到了文本消息");
24 }
25 }