From 88e5c8fb9cb5b1e74827b68cc3594294709d48a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= <2450572350@qq.com> Date: Tue, 6 Jun 2023 16:50:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=AE=9E=E7=8E=B0=E7=B1=BB,?= =?UTF-8?q?=E5=8F=AA=E9=9C=80=E8=A6=81=E5=AE=9E=E7=8E=B0=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8D=B3=E5=8F=AF=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- java_client/README.md | 3 +++ .../src/main/java/com/example/wxhk/msg/WxMsgHandle.java | 4 +++- .../java/com/example/wxhk/server/impl/WxSmgServerImpl.java | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/java_client/README.md b/java_client/README.md index 8e2271c..590f061 100644 --- a/java_client/README.md +++ b/java_client/README.md @@ -11,6 +11,9 @@ com.example.wxhk.tcp.vertx.VertxTcp 这个是tcp服务端,接受信息 com.example.wxhk.tcp.vertx.InitWeChat 微信环境初始化 com.example.wxhk.tcp.vertx.ArrHandle 循环消息处理 + +com.example.wxhk.server.WxSmgServer 为消息处理接口,实现其中的方法即可 + ![image](https://github.com/sglmsn/wxhelper/assets/36943585/59d49401-a492-46a9-8ed9-dab7fb1822b4) diff --git a/java_client/src/main/java/com/example/wxhk/msg/WxMsgHandle.java b/java_client/src/main/java/com/example/wxhk/msg/WxMsgHandle.java index a1453ed..dbfc8aa 100644 --- a/java_client/src/main/java/com/example/wxhk/msg/WxMsgHandle.java +++ b/java_client/src/main/java/com/example/wxhk/msg/WxMsgHandle.java @@ -54,7 +54,9 @@ public class WxMsgHandle { return null; }, WxMsgType.私聊信息); add(chatMsg -> { - wxSmgServer.文件助手(chatMsg); + if (FILEHELPER.equals(chatMsg.getFromUser())) { + wxSmgServer.文件助手(chatMsg); + } return 1; }, WxMsgType.收到转账之后或者文件助手等信息); add(chatMsg -> { diff --git a/java_client/src/main/java/com/example/wxhk/server/impl/WxSmgServerImpl.java b/java_client/src/main/java/com/example/wxhk/server/impl/WxSmgServerImpl.java index fcae972..3bfebd9 100644 --- a/java_client/src/main/java/com/example/wxhk/server/impl/WxSmgServerImpl.java +++ b/java_client/src/main/java/com/example/wxhk/server/impl/WxSmgServerImpl.java @@ -37,9 +37,7 @@ public class WxSmgServerImpl implements com.example.wxhk.server.WxSmgServer { @Override public void 文件助手(PrivateChatMsg chatMsg) { - if (FILEHELPER.equals(chatMsg.getFromUser())) { - log.info("文件助手:{},", chatMsg.getContent()); - } + } @Override