This commit is contained in:
jinyu 2016-05-09 22:44:50 +08:00
parent 098ae0539f
commit 2b8eef34e1
2 changed files with 6 additions and 1 deletions

View File

@ -48,12 +48,14 @@
<groupId>com.foxinmy</groupId> <groupId>com.foxinmy</groupId>
<artifactId>weixin4j-mp</artifactId> <artifactId>weixin4j-mp</artifactId>
<version>1.6.9</version> <version>1.6.9</version>
<optional>true</optional>
</dependency> </dependency>
<!-- 微信企业号 --> <!-- 微信企业号 -->
<dependency> <dependency>
<groupId>com.foxinmy</groupId> <groupId>com.foxinmy</groupId>
<artifactId>weixin4j-qy</artifactId> <artifactId>weixin4j-qy</artifactId>
<version>1.6.9</version> <version>1.6.9</version>
<optional>true</optional>
</dependency> </dependency>
<!-- 微信被动消息(回调模式) --> <!-- 微信被动消息(回调模式) -->
<dependency> <dependency>
@ -66,6 +68,7 @@
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>2.6.0</version> <version>2.6.0</version>
<optional>true</optional>
</dependency> </dependency>
<!-- 使用spring容器管理Handler时需要引用,针对weixin4j-server --> <!-- 使用spring容器管理Handler时需要引用,针对weixin4j-server -->
<dependency> <dependency>

View File

@ -1,6 +1,7 @@
package com.foxinmy.weixin4j.example.server; package com.foxinmy.weixin4j.example.server;
import com.foxinmy.weixin4j.exception.WeixinException; import com.foxinmy.weixin4j.exception.WeixinException;
import com.foxinmy.weixin4j.handler.DebugMessageHandler;
import com.foxinmy.weixin4j.startup.WeixinServerBootstrap; import com.foxinmy.weixin4j.startup.WeixinServerBootstrap;
/** /**
@ -39,7 +40,8 @@ public class Weixin4jServerStartupWithoutThread {
*/ */
public static void main(String[] args) throws WeixinException { public static void main(String[] args) throws WeixinException {
new WeixinServerBootstrap(aesToken) new WeixinServerBootstrap(aesToken)
.handlerPackagesToScan(handlerPackage).openAlwaysResponse() .handlerPackagesToScan(handlerPackage)
.addHandler(DebugMessageHandler.global).openAlwaysResponse()
.startup(port); .startup(port);
} }
} }