xujunwei 3 سال پیش
والد
کامیت
93d918e447

+ 9 - 4
framework-common/src/main/java/com/mrxu/framework/common/weixin/msg/InMsgParaser.java

@@ -3,10 +3,7 @@ package com.mrxu.framework.common.weixin.msg;
 
 import com.mrxu.framework.common.util.StrFunc;
 import com.mrxu.framework.common.weixin.msg.in.*;
-import com.mrxu.framework.common.weixin.msg.in.event.InFollowEvent;
-import com.mrxu.framework.common.weixin.msg.in.event.InLocationEvent;
-import com.mrxu.framework.common.weixin.msg.in.event.InMenuEvent;
-import com.mrxu.framework.common.weixin.msg.in.event.InQrCodeEvent;
+import com.mrxu.framework.common.weixin.msg.in.event.*;
 import com.mrxu.framework.common.weixin.msg.in.speech_recognition.InSpeechRecognitionResults;
 import org.dom4j.Document;
 import org.dom4j.DocumentException;
@@ -177,6 +174,14 @@ public class InMsgParaser {
 			e.setEventKey(eventKey);
 			return e;
 		}
+
+		// 模板消息发送成功
+		if ("TEMPLATESENDJOBFINISH".equals(event)) {
+			TemplateSendJobFinishEvent e = new TemplateSendJobFinishEvent(toUserName, fromUserName, createTime, msgType);
+			e.setMsgId(root.elementText("MsgID"));
+			e.setStatus(root.elementText("Status"));
+			return e;
+		}
 		
 		throw new RuntimeException("无法识别的事件类型,请查阅微信公众平台开发文档");
 	}

+ 43 - 0
framework-common/src/main/java/com/mrxu/framework/common/weixin/msg/in/event/TemplateSendJobFinishEvent.java

@@ -0,0 +1,43 @@
+package com.mrxu.framework.common.weixin.msg.in.event;
+
+import com.mrxu.framework.common.weixin.msg.in.InMsg;
+import lombok.Data;
+
+/**
+ * @Author: xujunwei
+<xml><ToUserName><![CDATA[gh_fa5b6550995e]]></ToUserName>
+<FromUserName><![CDATA[o0Jg_1Xf8qpj43iM53hlK4k7W1sQ]]></FromUserName>
+<CreateTime>1650089240</CreateTime>
+<MsgType><![CDATA[event]]></MsgType>
+<Event><![CDATA[TEMPLATESENDJOBFINISH]]></Event>
+<MsgID>2357147993155747842</MsgID>
+<Status><![CDATA[success]]></Status>
+</xml>
+ * @Description:
+ */
+public class TemplateSendJobFinishEvent extends InMsg {
+
+    public TemplateSendJobFinishEvent(String toUserName, String fromUserName, Integer createTime, String msgType) {
+        super(toUserName, fromUserName, createTime, msgType);
+    }
+
+    private String msgId;
+
+    private String status;
+
+    public String getMsgId() {
+        return msgId;
+    }
+
+    public void setMsgId(String msgId) {
+        this.msgId = msgId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+}