View Javadoc
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.mp.event.ScribeEventMessage;
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   * @className SubscribeMessageHandler
15   * @author jinyu(foxinmy@gmail.com)
16   * @date 2015年12月3日
17   * @since JDK 1.6
18   */
19  @Component
20  public class SubscribeMessageHandler extends MessageHandlerAdapter<ScribeEventMessage> {
21  
22      @Override
23      public WeixinResponse doHandle0(ScribeEventMessage message) {
24          return new TextResponse("欢迎关注~");
25      }
26  }