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.VoiceMessage;
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 VoiceMessageHandler extends MessageHandlerAdapter<VoiceMessage> {
21
22 @Override
23 public WeixinResponse doHandle0(VoiceMessage message) {
24
25
26
27 return new TextResponse("你讲了一句话");
28 }
29 }