Parcourir la source

feat: add some events

Your Name il y a 3 ans
Parent
révision
c3bf35a679
1 fichiers modifiés avec 42 ajouts et 14 suppressions
  1. 42
    14
      api/event/types.go

+ 42
- 14
api/event/types.go Voir le fichier

@@ -77,43 +77,43 @@ type AuthorizerEvent struct {
77 77
 	MsgID        int64    `xml:"MsgId"`
78 78
 }
79 79
 
80
-// TextEvent 文本消息
81
-type TextEvent struct {
80
+// TextMessage 文本消息
81
+type TextMessage struct {
82 82
 	AuthorizerEvent
83 83
 	Content CDATA `xml:"Content"`
84 84
 }
85 85
 
86
-// ImageEvent 图片消息
87
-type ImageEvent struct {
86
+// ImageMessage 图片消息
87
+type ImageMessage struct {
88 88
 	AuthorizerEvent
89 89
 	PicURL  CDATA `xml:"PicUrl"`
90 90
 	MediaID CDATA `xml:"MediaId"`
91 91
 }
92 92
 
93
-// VoiceEvent 语音消息
94
-type VoiceEvent struct {
93
+// VoiceMessage 语音消息
94
+type VoiceMessage struct {
95 95
 	AuthorizerEvent
96 96
 	MediaID     CDATA `xml:"MediaId"`
97 97
 	Format      CDATA `xml:"Format"`
98 98
 	Recognition CDATA `xml:"Recognition"`
99 99
 }
100 100
 
101
-// VideoEvent 视频消息
102
-type VideoEvent struct {
101
+// VideoMessage 视频消息
102
+type VideoMessage struct {
103 103
 	AuthorizerEvent
104 104
 	MediaID      CDATA `xml:"MediaId"`
105 105
 	ThumbMediaID CDATA `xml:"ThumbMediaId"`
106 106
 }
107 107
 
108
-// ShortVideoEvent 小视频消息
109
-type ShortVideoEvent struct {
108
+// ShortVideoMessage 小视频消息
109
+type ShortVideoMessage struct {
110 110
 	AuthorizerEvent
111 111
 	MediaID      CDATA `xml:"MediaId"`
112 112
 	ThumbMediaID CDATA `xml:"ThumbMediaId"`
113 113
 }
114 114
 
115
-// LocationEvent 地理位置消息
116
-type LocationEvent struct {
115
+// LocationMessage 地理位置消息
116
+type LocationMessage struct {
117 117
 	AuthorizerEvent
118 118
 	LocationX float64 `xml:"Location_X"`
119 119
 	LocationY float64 `xml:"Location_Y"`
@@ -121,10 +121,38 @@ type LocationEvent struct {
121 121
 	Label     CDATA   `xml:"Label"`
122 122
 }
123 123
 
124
-// LinkEvent 链接消息
125
-type LinkEvent struct {
124
+// LinkMessage 链接消息
125
+type LinkMessage struct {
126 126
 	AuthorizerEvent
127 127
 	Title       CDATA `xml:"Title"`
128 128
 	Description CDATA `xml:"Description"`
129 129
 	URL         CDATA `xml:"Url"`
130 130
 }
131
+
132
+// SubscribeEvent 关注/取消关注事件
133
+// event subscribe(订阅)、unsubscribe(取消订阅)
134
+type SubscribeEvent struct {
135
+	AuthorizerEvent
136
+}
137
+
138
+// QRSceneEvent 扫描带参数二维码事件
139
+type QRSceneEvent struct {
140
+	AuthorizerEvent
141
+	EventKey CDATA `xml:"EventKey"`
142
+	Ticket   CDATA `xml:"Ticket"`
143
+}
144
+
145
+// LocationEvent 上报地理位置事件
146
+type LocationEvent struct {
147
+	AuthorizerEvent
148
+	Latitude  float64 `xml:"Latitude"`
149
+	Longitude float64 `xml:"Longitude"`
150
+	Precision float64 `xml:"Precision"`
151
+}
152
+
153
+// MenuEvent 自定义菜单事件
154
+// event 值为 CLICK
155
+type MenuEvent struct {
156
+	AuthorizerEvent
157
+	EventKey CDATA `xml:"EventKey"`
158
+}