-
Notifications
You must be signed in to change notification settings - Fork 13
/
成员管理-邮箱获取userid.go
executable file
·59 lines (50 loc) · 1.75 KB
/
成员管理-邮箱获取userid.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
package apis
import (
"encoding/json"
)
// 自动生成的文件, 生成方式: make api doc=微信文档地址url
// 可自行修改生成的文件,以满足开发需求
// ReqGetUseridByEmailUser 邮箱获取userid请求
// 文档:https://developer.work.weixin.qq.com/document/path/95892#邮箱获取userid
type ReqGetUseridByEmailUser struct {
// Email 邮箱,必填
Email string `json:"email"`
// EmailType 邮箱类型:1-企业邮箱(默认);2-个人邮箱
EmailType int `json:"email_type,omitempty"`
}
var _ bodyer = ReqGetUseridByEmailUser{}
func (x ReqGetUseridByEmailUser) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
// RespGetUseridByEmailUser 邮箱获取userid响应
// 文档:https://developer.work.weixin.qq.com/document/path/95892#邮箱获取userid
type RespGetUseridByEmailUser struct {
CommonResp
// Userid 成员UserID。注意:已升级openid的代开发或第三方,获取的是密文userid
Userid string `json:"userid"`
}
var _ bodyer = RespGetUseridByEmailUser{}
func (x RespGetUseridByEmailUser) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
// ExecGetUseridByEmailUser 邮箱获取userid
// 文档:https://developer.work.weixin.qq.com/document/path/95892#邮箱获取userid
func (c *ApiClient) ExecGetUseridByEmailUser(req ReqGetUseridByEmailUser) (RespGetUseridByEmailUser, error) {
var resp RespGetUseridByEmailUser
err := c.executeWXApiPost("/cgi-bin/user/get_userid_by_email", req, &resp, true)
if err != nil {
return RespGetUseridByEmailUser{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return RespGetUseridByEmailUser{}, bizErr
}
return resp, nil
}