优化HttpClientFatory
This commit is contained in:
+2
-1
@@ -3,6 +3,7 @@ package com.foxinmy.weixin4j.example.server;
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.handler.DebugMessageHandler;
|
||||
import com.foxinmy.weixin4j.startup.WeixinServerBootstrap;
|
||||
import com.foxinmy.weixin4j.util.AesToken;
|
||||
|
||||
/**
|
||||
* 微信消息服务:单独作为一个服务jar包启动,推荐这种方式去处理微信消息,可在本项目的根目录运行 `mvn package`得到一个可执行的zip包。
|
||||
@@ -38,7 +39,7 @@ public final class Weixin4jServerStartup {
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public static void main(String[] args) throws WeixinException {
|
||||
new WeixinServerBootstrap(aesToken) // 指定开发者token信息。
|
||||
new WeixinServerBootstrap(new AesToken("wxa652fc930afe9b22", "weixin4j", "iFv2hlZm56rkwv5oC45UoIfvPJVHp2ngocBMbt5FP9C")) // 指定开发者token信息。
|
||||
.handlerPackagesToScan(handlerPackage) // 扫描处理消息的包。
|
||||
.addHandler(DebugMessageHandler.global) // 当没有匹配到消息处理时输出调试信息,开发环境打开。
|
||||
.openAlwaysResponse() // 当没有匹配到消息处理时输出空白回复(公众号不会出现「该公众号无法提供服务的提示」),正式环境打开。
|
||||
|
||||
-1
@@ -19,7 +19,6 @@ import com.foxinmy.weixin4j.response.WeixinResponse;
|
||||
*/
|
||||
@Component
|
||||
public class TextMessageHandler extends MessageHandlerAdapter<TextMessage> {
|
||||
|
||||
@Override
|
||||
public WeixinResponse doHandle0(WeixinRequest request, TextMessage message)
|
||||
throws WeixinException {
|
||||
|
||||
Reference in New Issue
Block a user