-
Notifications
You must be signed in to change notification settings - Fork 140
/
events.go
40 lines (35 loc) · 1.66 KB
/
events.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package openplatform
import "encoding/xml"
const EVENT_AUTHORIZED string = "authorized"
const EVENT_UNAUTHORIZED string = "unauthorized"
const EVENT_UPDATE_AUTHORIZED string = "updateauthorized"
const EVENT_COMPONENT_VERIFY_TICKET string = "component_verify_ticket"
const EVENT_THIRD_FAST_REGISTERED string = "notify_third_fasteregister"
type Callback struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
AppID string `xml:"AppId"`
Encrypt string `xml:"Encrypt"`
}
// ------------------------------------------------------------
// https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Before_Develop/component_verify_ticket.html
type EventVerifyTicket struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
CreateTime string `xml:"CreateTime"`
InfoType string `xml:"InfoType"`
ComponentVerifyTicket string `xml:"ComponentVerifyTicket"`
}
// 授权变更通知推送
// https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Before_Develop/authorize_event.html
type EventAuthorization struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
AppId string `xml:"AppId"`
CreateTime string `xml:"CreateTime"`
InfoType string `xml:"InfoType"`
AuthorizerAppid string `xml:"AuthorizerAppid"`
AuthorizationCode string `xml:"AuthorizationCode"`
AuthorizationCodeExpiredTime string `xml:"AuthorizationCodeExpiredTime"`
PreAuthCode string `xml:"PreAuthCode"`
}