Browse Source

:zap: 升级wxJava为最新版本

Aron 6 years ago
parent
commit
d0f3b9cfa3

+ 6 - 1
pom.xml

@@ -28,7 +28,7 @@
 		<mybatisplus-spring-boot-starter.version>1.0.5</mybatisplus-spring-boot-starter.version>
 		<velocity.version>1.7</velocity.version>
 		<activiti.version>5.22.0</activiti.version>
-		<weixin-java-mp.version>3.0.0</weixin-java-mp.version>
+		<weixin-java-mp.version>3.3.0</weixin-java-mp.version>
 		<poi.version>3.14</poi.version>
 		<qiniu.version>[7.0.0, 7.2.99]</qiniu.version>
 		<oltu.version>1.0.2</oltu.version>
@@ -153,6 +153,11 @@
 			<artifactId>weixin-java-mp</artifactId>
 			<version>${weixin-java-mp.version}</version>
 		</dependency>
+		<dependency>
+			<groupId>com.github.binarywang</groupId>
+			<artifactId>weixin-java-miniapp</artifactId>
+			<version>${weixin-java-mp.version}</version>
+		</dependency>
 		<!-- weixin SDK E -->
 
 		<dependency>

+ 1 - 1
src/main/java/com/ifast/wxmp/controller/mp/WxMediaController.java

@@ -13,7 +13,7 @@ import com.ifast.wxmp.service.WeixinService;
 import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.api.WxConsts;
 import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
-import me.chanjar.weixin.common.exception.WxErrorException;
+import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.mp.bean.WxMpMassNews;
 import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage;
 import me.chanjar.weixin.mp.bean.material.WxMpMaterial;

+ 1 - 1
src/main/java/com/ifast/wxmp/controller/mp/WxMenuController.java

@@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.api.WxConsts;
 import me.chanjar.weixin.common.bean.menu.WxMenu;
 import me.chanjar.weixin.common.bean.menu.WxMenuButton;
-import me.chanjar.weixin.common.exception.WxErrorException;
+import me.chanjar.weixin.common.error.WxErrorException;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;

+ 1 - 1
src/main/java/com/ifast/wxmp/handler/SubscribeHandler.java

@@ -8,7 +8,7 @@ import com.ifast.wxmp.service.MpConfigService;
 import com.ifast.wxmp.service.MpFansService;
 import com.ifast.wxmp.service.WeixinService;
 import com.ifast.wxmp.util.WxMpConfigHolder;
-import me.chanjar.weixin.common.exception.WxErrorException;
+import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.common.session.WxSessionManager;
 import me.chanjar.weixin.mp.api.WxMpService;
 import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;

+ 1 - 1
src/main/java/com/ifast/wxmp/service/impl/MpFansServiceImpl.java

@@ -11,7 +11,7 @@ import com.ifast.wxmp.service.MpConfigService;
 import com.ifast.wxmp.service.MpFansService;
 import com.ifast.wxmp.service.WeixinService;
 import com.ifast.wxmp.util.WxMpConfigHolder;
-import me.chanjar.weixin.common.exception.WxErrorException;
+import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.mp.api.WxMpUserService;
 import me.chanjar.weixin.mp.bean.result.WxMpUser;
 import me.chanjar.weixin.mp.bean.result.WxMpUserList;

+ 3 - 2
src/main/java/com/ifast/wxmp/util/WxMpConfigHolder.java

@@ -1,5 +1,6 @@
 package com.ifast.wxmp.util;
 
+import com.ifast.common.utils.JSONUtils;
 import com.ifast.wxmp.service.MpConfigService;
 import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
 import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
@@ -45,7 +46,7 @@ public class WxMpConfigHolder implements InitializingBean {
     @Override
     public void afterPropertiesSet(){
         mpConfigService.selectList(null).stream().forEach(bean -> {
-            final WxMpInMemoryConfigStorage config = new WxMpInMemoryConfigStorage();
+            WxMpInMemoryConfigStorage config = new WxMpInMemoryConfigStorage();
             // 设置微信公众号的appid
             config.setAppId(bean.getAppId());
             // 设置微信公众号的app corpSecret
@@ -57,7 +58,7 @@ public class WxMpConfigHolder implements InitializingBean {
 
             config.setApacheHttpClientBuilder(DefaultApacheHttpClientBuilder.get());
 
-            log.debug("公众号配置初始化:{}", config);
+            log.debug("公众号配置初始化:{}", JSONUtils.beanToJson(config));
             mpConfigs.put(bean.getAppId(), config);
 
         });