forked from l306287405/wechat3rd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.go
32 lines (28 loc) · 869 Bytes
/
plugin.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
package wechat3rd
import (
"github.com/l306287405/wechat3rd/core"
)
type PluginReq struct {
Action string `json:"action"`
PluginAppId *string `json:"plugin_appid,omitempty"`
UserVersion *string `json:"user_version,omitempty"`
}
type PluginResp struct {
core.Error
PluginList []*struct {
AppId string `json:"appid"`
Status int8 `json:"status"`
Nickname string `json:"nickname"`
HeadImgUrl string `json:"headimgurl"`
} `json:"plugin_list,omitempty"`
}
//小程序插件管理
//https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Business/pluginManager.html
func (s *Server) Plugin(authorizerAccessToken string, req *PluginReq) (resp *PluginResp) {
var (
u = WECHAT_API_URL + "/wxa/plugin?"
)
resp = &PluginResp{}
resp.Err(core.PostJson(s.AuthToken2url(u, authorizerAccessToken), req, resp))
return
}