处理消息

This commit is contained in:
wangw 2025-10-20 18:28:44 +08:00
parent 23e3cd0d76
commit 2c00b8214f
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ public class NotifyController {
// 读取 POST 请求体中的 XML 数据微信推送的消息格式为 XML // 读取 POST 请求体中的 XML 数据微信推送的消息格式为 XML
String xmlData = readPostXml(request); String xmlData = readPostXml(request);
JSONObject jsonObject = JSON.parseObject(xmlData); JSONObject jsonObject = JSON.parseObject(xmlData);
log.info("微信 POST 消息内容: {}", xmlData); log.info("微信 POST 消息内容: {}", jsonObject);
// 获取消息类型 event // 获取消息类型 event
String msgType = jsonObject.getString("MsgType"); String msgType = jsonObject.getString("MsgType");
// 获取事件类型 unsubscribe用户取消关注 subscribe用户关注 // 获取事件类型 unsubscribe用户取消关注 subscribe用户关注