Skip to content

Commit 91f37cf

Browse files
committed
update message handler
1 parent a8ba49d commit 91f37cf

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

src/main/java/com/github/handler/MsgHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.util.Map;
1111

1212
/**
13-
* 转发客户消息Handler
13+
* 转发客户消息给客服Handler
1414
*
1515
* Created by FirenzesEagle on 2016/7/27 0027.
1616
* Email:liumingbo2008@gmail.com

src/main/java/com/github/service/impl/CoreServiceImpl.java

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
package com.github.service.impl;
22

3-
import java.io.IOException;
4-
import java.nio.charset.StandardCharsets;
5-
import java.util.List;
6-
7-
import javax.annotation.PostConstruct;
8-
3+
import com.github.handler.LogHandler;
4+
import com.github.handler.MsgHandler;
5+
import com.github.handler.SubscribeHandler;
6+
import com.github.service.CoreService;
7+
import me.chanjar.weixin.common.api.WxConsts;
8+
import me.chanjar.weixin.common.exception.WxErrorException;
9+
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
10+
import me.chanjar.weixin.mp.api.WxMpService;
11+
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
12+
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
13+
import me.chanjar.weixin.mp.bean.result.WxMpUser;
914
import org.apache.http.HttpEntity;
1015
import org.apache.http.NameValuePair;
1116
import org.apache.http.client.ClientProtocolException;
@@ -22,18 +27,10 @@
2227
import org.springframework.beans.factory.annotation.Autowired;
2328
import org.springframework.stereotype.Service;
2429

25-
import com.github.handler.LogHandler;
26-
import com.github.handler.MsgHandler;
27-
import com.github.handler.SubscribeHandler;
28-
import com.github.service.CoreService;
29-
30-
import me.chanjar.weixin.common.api.WxConsts;
31-
import me.chanjar.weixin.common.exception.WxErrorException;
32-
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
33-
import me.chanjar.weixin.mp.api.WxMpService;
34-
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
35-
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
36-
import me.chanjar.weixin.mp.bean.result.WxMpUser;
30+
import javax.annotation.PostConstruct;
31+
import java.io.IOException;
32+
import java.nio.charset.StandardCharsets;
33+
import java.util.List;
3734

3835
/**
3936
* Created by FirenzesEagle on 2016/5/30 0030.
@@ -106,8 +103,8 @@ public void refreshRouter() {
106103
// 关注事件
107104
newRouter.rule().async(false).msgType(WxConsts.XML_MSG_EVENT)
108105
.event(WxConsts.EVT_SUBSCRIBE).handler(this.subscribeHandler)
109-
.end();
110-
// 默认
106+
.next();
107+
// 默认,转发消息给客服人员
111108
newRouter.rule().async(false).handler(this.msgHandler).end();
112109
this.router = newRouter;
113110
}

0 commit comments

Comments
 (0)