14
14
import com .github .binarywang .demo .wx .mp .handler .MenuHandler ;
15
15
import com .github .binarywang .demo .wx .mp .handler .MsgHandler ;
16
16
import com .github .binarywang .demo .wx .mp .handler .NullHandler ;
17
+ import com .github .binarywang .demo .wx .mp .handler .ScanHandler ;
17
18
import com .github .binarywang .demo .wx .mp .handler .StoreCheckNotifyHandler ;
18
19
import com .github .binarywang .demo .wx .mp .handler .SubscribeHandler ;
19
20
import com .github .binarywang .demo .wx .mp .handler .UnsubscribeHandler ;
@@ -43,6 +44,7 @@ public class WxMpConfiguration {
43
44
private MsgHandler msgHandler ;
44
45
private UnsubscribeHandler unsubscribeHandler ;
45
46
private SubscribeHandler subscribeHandler ;
47
+ private ScanHandler scanHandler ;
46
48
47
49
private WxMpProperties properties ;
48
50
@@ -53,7 +55,7 @@ public class WxMpConfiguration {
53
55
public WxMpConfiguration (LogHandler logHandler , NullHandler nullHandler , KfSessionHandler kfSessionHandler ,
54
56
StoreCheckNotifyHandler storeCheckNotifyHandler , LocationHandler locationHandler ,
55
57
MenuHandler menuHandler , MsgHandler msgHandler , UnsubscribeHandler unsubscribeHandler ,
56
- SubscribeHandler subscribeHandler , WxMpProperties properties ) {
58
+ SubscribeHandler subscribeHandler , ScanHandler scanHandler , WxMpProperties properties ) {
57
59
this .logHandler = logHandler ;
58
60
this .nullHandler = nullHandler ;
59
61
this .kfSessionHandler = kfSessionHandler ;
@@ -63,6 +65,7 @@ public WxMpConfiguration(LogHandler logHandler, NullHandler nullHandler, KfSessi
63
65
this .msgHandler = msgHandler ;
64
66
this .unsubscribeHandler = unsubscribeHandler ;
65
67
this .subscribeHandler = subscribeHandler ;
68
+ this .scanHandler = scanHandler ;
66
69
this .properties = properties ;
67
70
}
68
71
@@ -147,7 +150,7 @@ private WxMpMessageRouter newRouter(WxMpService wxMpService) {
147
150
148
151
// 扫码事件
149
152
newRouter .rule ().async (false ).msgType (XmlMsgType .EVENT )
150
- .event (EventType .SCAN ).handler (this .nullHandler ).end ();
153
+ .event (EventType .SCAN ).handler (this .scanHandler ).end ();
151
154
152
155
// 默认
153
156
newRouter .rule ().async (false ).handler (this .msgHandler ).end ();
0 commit comments