|
@@ -4,6 +4,31 @@ import (
|
|
|
"encoding/xml"
|
|
|
)
|
|
|
|
|
|
+// Client wechat
|
|
|
+type Client struct {
|
|
|
+ AppID string `json:"appid"`
|
|
|
+ AppSecret string `json:"appsecret"`
|
|
|
+ Token string `json:"token"`
|
|
|
+ EncodingAESKey string `json:"encodingaeskey"`
|
|
|
+
|
|
|
+ //ReadLock *sync.Mutex
|
|
|
+
|
|
|
+ AccessToken string
|
|
|
+ LastTokenTime int64
|
|
|
+
|
|
|
+ Ticket string
|
|
|
+ LastTicketTime int64
|
|
|
+}
|
|
|
+
|
|
|
+// MiniClient wechat mini
|
|
|
+type MiniClient struct {
|
|
|
+ AppID string `json:"appid"`
|
|
|
+ AppSecret string `json:"appsecret"`
|
|
|
+
|
|
|
+ AccessToken string
|
|
|
+ LastTokenTime int64
|
|
|
+}
|
|
|
+
|
|
|
// FormSignature signature
|
|
|
type FormSignature struct {
|
|
|
TimeStamp string `form:"timestamp" json:"timestamp"`
|
|
@@ -124,10 +149,38 @@ type Message struct {
|
|
|
Longitude string `xml:"Longitude,omitempty" json:"Longitude,omitempty"` // 经度
|
|
|
Precision string `xml:"Precision,omitempty" json:"Precision,omitempty"` // 地理位置精度
|
|
|
|
|
|
- MsgID int64 `xml:"MsgId,omitempty" json:"MsgId,omitempty"` // 消息id
|
|
|
+ MsgID int64 `xml:"MsgID,omitempty" json:"MsgID,omitempty"` // 消息id
|
|
|
Status string `xml:"Status,omitempty" json:"Status,omitempty"` // 消息发送状态
|
|
|
}
|
|
|
|
|
|
+type menuSubButtonList struct {
|
|
|
+ Type string `json:"type"`
|
|
|
+ Name string `json:"name"`
|
|
|
+ Key string `json:"key"`
|
|
|
+ URL string `json:"url"`
|
|
|
+}
|
|
|
+
|
|
|
+type menuSubButton struct {
|
|
|
+ List []menuSubButtonList `json:"list"`
|
|
|
+}
|
|
|
+
|
|
|
+type menuButton struct {
|
|
|
+ Type string `json:"type"`
|
|
|
+ Name string `json:"name"`
|
|
|
+ Key string `json:"key"`
|
|
|
+ SubButton menuSubButton `json:"sub_button"`
|
|
|
+}
|
|
|
+
|
|
|
+type menuInfo struct {
|
|
|
+ Button []menuButton `json:"button"`
|
|
|
+}
|
|
|
+
|
|
|
+// Menu menu
|
|
|
+type Menu struct {
|
|
|
+ IsOpen int64 `json:"is_menu_open"`
|
|
|
+ Info menuInfo `json:"selfmenu_info"`
|
|
|
+}
|
|
|
+
|
|
|
// ArticleItem article item
|
|
|
type ArticleItem struct {
|
|
|
Title string `xml:"Title" json:"Title"`
|
|
@@ -196,31 +249,6 @@ type SignPackage struct {
|
|
|
URL string `json:"url"`
|
|
|
}
|
|
|
|
|
|
-// Client wechat
|
|
|
-type Client struct {
|
|
|
- AppID string `json:"appid"`
|
|
|
- AppSecret string `json:"appsecret"`
|
|
|
- Token string `json:"token"`
|
|
|
- EncodingAESKey string `json:"encodingaeskey"`
|
|
|
-
|
|
|
- //ReadLock *sync.Mutex
|
|
|
-
|
|
|
- AccessToken string
|
|
|
- LastTokenTime int64
|
|
|
-
|
|
|
- Ticket string
|
|
|
- LastTicketTime int64
|
|
|
-}
|
|
|
-
|
|
|
-// MiniClient wechat mini
|
|
|
-type MiniClient struct {
|
|
|
- AppID string `json:"appid"`
|
|
|
- AppSecret string `json:"appsecret"`
|
|
|
-
|
|
|
- AccessToken string
|
|
|
- LastTokenTime int64
|
|
|
-}
|
|
|
-
|
|
|
// FormMaterial Material
|
|
|
type FormMaterial struct {
|
|
|
Type string `form:"type"`
|
|
@@ -249,6 +277,11 @@ type UserInfo struct {
|
|
|
QrSceneStr string `json:"qr_scene_str"`
|
|
|
}
|
|
|
|
|
|
+// FormNextOpenID next openid
|
|
|
+type FormNextOpenID struct {
|
|
|
+ Next string `form:"next_openid"`
|
|
|
+}
|
|
|
+
|
|
|
// List openid list
|
|
|
type List struct {
|
|
|
OpenID []string `json:"openid"`
|