Skip to content

Commit 9b3e6c3

Browse files
committed
support okhttp
1 parent 81e31b7 commit 9b3e6c3

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,19 @@
3131
<groupId>com.github.binarywang</groupId>
3232
<artifactId>weixin-java-mp</artifactId>
3333
<version>${weixin-java-mp.version}</version>
34+
<exclusions>
35+
<exclusion>
36+
<groupId>org.apache.httpcomponents</groupId>
37+
<artifactId>*</artifactId>
38+
</exclusion>
39+
</exclusions>
3440
</dependency>
3541

42+
<dependency>
43+
<groupId>com.squareup.okhttp3</groupId>
44+
<artifactId>okhttp</artifactId>
45+
<version>3.7.0</version>
46+
</dependency>
3647
<dependency>
3748
<groupId>com.alibaba</groupId>
3849
<artifactId>fastjson</artifactId>

src/main/java/com/github/binarywang/demo/spring/service/WeixinService.java

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,29 @@
11
package com.github.binarywang.demo.spring.service;
22

3-
import javax.annotation.PostConstruct;
4-
5-
import me.chanjar.weixin.mp.constant.WxMpEventConstants;
6-
import org.slf4j.Logger;
7-
import org.slf4j.LoggerFactory;
8-
import org.springframework.beans.factory.annotation.Autowired;
9-
import org.springframework.stereotype.Service;
10-
113
import com.github.binarywang.demo.spring.config.WxMpConfig;
12-
import com.github.binarywang.demo.spring.handler.AbstractHandler;
13-
import com.github.binarywang.demo.spring.handler.KfSessionHandler;
14-
import com.github.binarywang.demo.spring.handler.LocationHandler;
15-
import com.github.binarywang.demo.spring.handler.LogHandler;
16-
import com.github.binarywang.demo.spring.handler.MenuHandler;
17-
import com.github.binarywang.demo.spring.handler.MsgHandler;
18-
import com.github.binarywang.demo.spring.handler.NullHandler;
19-
import com.github.binarywang.demo.spring.handler.StoreCheckNotifyHandler;
20-
import com.github.binarywang.demo.spring.handler.SubscribeHandler;
21-
import com.github.binarywang.demo.spring.handler.UnsubscribeHandler;
22-
4+
import com.github.binarywang.demo.spring.handler.*;
235
import me.chanjar.weixin.common.api.WxConsts;
246
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
257
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
26-
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
8+
import me.chanjar.weixin.mp.api.impl.WxMpServiceOkHttpImpl;
279
import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfOnlineList;
2810
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
2911
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
12+
import me.chanjar.weixin.mp.constant.WxMpEventConstants;
13+
import org.slf4j.Logger;
14+
import org.slf4j.LoggerFactory;
15+
import org.springframework.beans.factory.annotation.Autowired;
16+
import org.springframework.stereotype.Service;
17+
18+
import javax.annotation.PostConstruct;
3019

3120
/**
3221
*
3322
* @author Binary Wang
3423
*
3524
*/
3625
@Service
37-
public class WeixinService extends WxMpServiceImpl {
26+
public class WeixinService extends WxMpServiceOkHttpImpl {
3827
private final Logger logger = LoggerFactory.getLogger(this.getClass());
3928

4029
@Autowired

0 commit comments

Comments
 (0)