diff --git a/callbacks/callback_constant.go b/callbacks/callback_constant.go index a56b005..ed2d2f7 100644 --- a/callbacks/callback_constant.go +++ b/callbacks/callback_constant.go @@ -138,6 +138,12 @@ const EventTypeDeviceDataAuthChange = "device_data_auth_change" // 异步上传临时素材-回调异步任务结果 const EventTypeUploadMediaJobFinish = "upload_media_job_finish" +// 长期未使用应用临时停用事件 +const EventTypeCloseInactiveAgent = "close_inactive_agent" + +// 长期未使用应用重新启用事件 +const EventTypeReopenInactiveAgent = "reopen_inactive_agent" + // 推送suite_ticket const InfoTypeSuiteTicket EventType = "suite_ticket" diff --git "a/callbacks/event\351\225\277\346\234\237\346\234\252\344\275\277\347\224\250\345\272\224\347\224\250\344\270\264\346\227\266\345\201\234\347\224\250\344\272\213\344\273\266.go" "b/callbacks/event\351\225\277\346\234\237\346\234\252\344\275\277\347\224\250\345\272\224\347\224\250\344\270\264\346\227\266\345\201\234\347\224\250\344\272\213\344\273\266.go" new file mode 100755 index 0000000..3b8a4ff --- /dev/null +++ "b/callbacks/event\351\225\277\346\234\237\346\234\252\344\275\277\347\224\250\345\272\224\347\224\250\344\270\264\346\227\266\345\201\234\347\224\250\344\272\213\344\273\266.go" @@ -0,0 +1,56 @@ +package callbacks + +import "encoding/xml" + +// 自动生成的回调结构,按需修改, 生成方式: make callback doc=微信文档地址url +// 文档: https://developer.work.weixin.qq.com/document/path/90376#长期未使用应用临时停用事件 + +func init() { + // 添加可解析的回调事件 + supportCallback(EventCloseInactiveAgent{}) +} + +type EventCloseInactiveAgent struct { + XMLName xml.Name `xml:"xml"` + Text string `xml:",chardata"` + ToUserName struct { + Text string `xml:",chardata"` + } `xml:"ToUserName"` + FromUserName struct { + Text string `xml:",chardata"` + } `xml:"FromUserName"` + CreateTime struct { + Text string `xml:",chardata"` + } `xml:"CreateTime"` + MsgType struct { + Text string `xml:",chardata"` + } `xml:"MsgType"` + Event struct { + Text string `xml:",chardata"` + } `xml:"Event"` + AgentID struct { + Text string `xml:",chardata"` + } `xml:"AgentID"` +} + +func (EventCloseInactiveAgent) GetMessageType() string { + return "event" +} + +func (EventCloseInactiveAgent) GetEventType() string { + return "close_inactive_agent" +} + +func (EventCloseInactiveAgent) GetChangeType() string { + return "" +} + +func (m EventCloseInactiveAgent) GetTypeKey() string { + return m.GetMessageType() + ":" + m.GetEventType() + ":" + m.GetChangeType() +} + +func (EventCloseInactiveAgent) ParseFromXml(data []byte) (CallBackExtraInfoInterface, error) { + var temp EventCloseInactiveAgent + err := xml.Unmarshal(data, &temp) + return temp, err +} diff --git "a/callbacks/event\351\225\277\346\234\237\346\234\252\344\275\277\347\224\250\345\272\224\347\224\250\351\207\215\346\226\260\345\220\257\347\224\250\344\272\213\344\273\266.go" "b/callbacks/event\351\225\277\346\234\237\346\234\252\344\275\277\347\224\250\345\272\224\347\224\250\351\207\215\346\226\260\345\220\257\347\224\250\344\272\213\344\273\266.go" new file mode 100755 index 0000000..c126f22 --- /dev/null +++ "b/callbacks/event\351\225\277\346\234\237\346\234\252\344\275\277\347\224\250\345\272\224\347\224\250\351\207\215\346\226\260\345\220\257\347\224\250\344\272\213\344\273\266.go" @@ -0,0 +1,56 @@ +package callbacks + +import "encoding/xml" + +// 自动生成的回调结构,按需修改, 生成方式: make callback doc=微信文档地址url +// 文档: https://developer.work.weixin.qq.com/document/path/90376#长期未使用应用重新启用事件 + +func init() { + // 添加可解析的回调事件 + supportCallback(EventReopenInactiveAgent{}) +} + +type EventReopenInactiveAgent struct { + XMLName xml.Name `xml:"xml"` + Text string `xml:",chardata"` + ToUserName struct { + Text string `xml:",chardata"` + } `xml:"ToUserName"` + FromUserName struct { + Text string `xml:",chardata"` + } `xml:"FromUserName"` + CreateTime struct { + Text string `xml:",chardata"` + } `xml:"CreateTime"` + MsgType struct { + Text string `xml:",chardata"` + } `xml:"MsgType"` + Event struct { + Text string `xml:",chardata"` + } `xml:"Event"` + AgentID struct { + Text string `xml:",chardata"` + } `xml:"AgentID"` +} + +func (EventReopenInactiveAgent) GetMessageType() string { + return "event" +} + +func (EventReopenInactiveAgent) GetEventType() string { + return "reopen_inactive_agent" +} + +func (EventReopenInactiveAgent) GetChangeType() string { + return "" +} + +func (m EventReopenInactiveAgent) GetTypeKey() string { + return m.GetMessageType() + ":" + m.GetEventType() + ":" + m.GetChangeType() +} + +func (EventReopenInactiveAgent) ParseFromXml(data []byte) (CallBackExtraInfoInterface, error) { + var temp EventReopenInactiveAgent + err := xml.Unmarshal(data, &temp) + return temp, err +}