-
Notifications
You must be signed in to change notification settings - Fork 13
/
应用授权-获取应用的管理员列表.go
executable file
·62 lines (53 loc) · 1.81 KB
/
应用授权-获取应用的管理员列表.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package apis
import (
"encoding/json"
)
// 自动生成的文件, 生成方式: make api doc=微信文档地址url
// 可自行修改生成的文件,以满足开发需求
// ReqGetAdminListService 获取应用的管理员列表请求
// 文档:https://developer.work.weixin.qq.com/document/path/90606#获取应用的管理员列表
type ReqGetAdminListService struct {
// Agentid 授权方安装的应用agentid,必填
Agentid int `json:"agentid"`
// AuthCorpid 授权方corpid,必填
AuthCorpid string `json:"auth_corpid"`
}
var _ bodyer = ReqGetAdminListService{}
func (x ReqGetAdminListService) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
// RespGetAdminListService 获取应用的管理员列表响应
// 文档:https://developer.work.weixin.qq.com/document/path/90606#获取应用的管理员列表
type RespGetAdminListService struct {
Admin []struct {
AuthType int `json:"auth_type"`
OpenUserid string `json:"open_userid"`
Userid string `json:"userid"`
} `json:"admin"`
CommonResp
}
var _ bodyer = RespGetAdminListService{}
func (x RespGetAdminListService) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
// ExecGetAdminListService 获取应用的管理员列表
// 文档:https://developer.work.weixin.qq.com/document/path/90606#获取应用的管理员列表
func (c *ApiClient) ExecGetAdminListService(req ReqGetAdminListService) (RespGetAdminListService, error) {
var resp RespGetAdminListService
err := c.executeWXApiPost("/cgi-bin/service/get_admin_list", req, &resp, true)
if err != nil {
return RespGetAdminListService{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return RespGetAdminListService{}, bizErr
}
return resp, nil
}