wxhelper/weChatHook-java/README.md

29 lines
786 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#maven打包
```aidl
进入weChatHook-java项目根目录执行如下命令进行打包
mvn package
打包完成后在target目录下找到
weChatHook-java-1.0-jar-with-dependencies.jar
文件就可以直接启动了
```
#启动命令
####命令参数说明
###port:监听的端口 默认端口19077
###hookApi消息转发的接口 为空不转发
```aidl
java -jar .\weChatHook-java-1.0-jar-with-dependencies.jar --port=9999 --hookApi=http://localhost:29099/api/demo/msg
```
#java接收hook消息示例
```aidl
@RequestMapping("/api/demo")
public class DemoController {
@PostMapping("/msg")
public void getMsg(String msg){
JSONObject jsonObject = JSON.parseObject(msg);
jsonObject.forEach((k,v)->{
System.out.println(k+":"+v);
});
}
```