Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions apis.md.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Name|Request Type|Response Type|Access Token|URL|Doc
`execUserJoinQrcode`|`reqUserJoinQrcode`|`respUserJoinQrcode`|+|`GET /cgi-bin/corp/get_join_qrcode`|[获取加入企业二维码](https://developer.work.weixin.qq.com/document/path/91714)
`execUserIDByMobile`|`reqUserIDByMobile`|`respUserIDByMobile`|+|`POST /cgi-bin/user/getuserid`|[手机号获取userid](https://work.weixin.qq.com/api/doc/90001/90143/91693)
`execUserIDByEmail`|`reqUserIDByEmail`|`respUserIDByEmail`|+|`POST /cgi-bin/user/get_userid_by_email`|[邮箱获取userid](https://developer.work.weixin.qq.com/document/path/95895)
`execUserDetail`|`reqUserDetail`|`respUserDetail`|+|`POST //cgi-bin/user/getuserdetail`|[获取访问用户敏感信息](https://developer.work.weixin.qq.com/document/path/95833)

# 部门管理

Expand Down
7 changes: 6 additions & 1 deletion errcodes/mod.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,22 @@ func (x reqUserInfoGet) intoURLValues() url.Values {
}
}

// reqUserDetail 获取成员详情
type reqUserDetail struct {
UserTicket string `json:"user_ticket"`
}

var _ bodyer = reqUserDetail{}

func (x reqUserDetail) intoBody() ([]byte, error) {
return marshalIntoJSONBody(x)
}

type respUserDetail struct {
respCommon
UserDetail
}

// respUserInfoGet 部门列表响应
type respUserInfoGet struct {
respCommon
Expand Down
13 changes: 13 additions & 0 deletions user_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type UserDetail struct {
Alias string `json:"alias"`
Status int `json:"status"`
QRCodeURL string `json:"qr_code"`
BizMail string `json:"biz_mail"`
Address string `json:"address"`
// TODO: extattr external_profile external_position
}

Expand Down Expand Up @@ -138,3 +140,14 @@ func (c *WorkwxApp) GetUserInfoByCode(code string) (*UserIdentityInfo, error) {
}
return &resp.UserIdentityInfo, nil
}

// GetUserDetail 获取用户敏感信息
func (c *WorkwxApp) GetUserDetail(userTicket string) (*UserDetail, error) {
resp, err := c.execUserDetail(reqUserDetail{
UserTicket: userTicket,
})
if err != nil {
return nil, err
}
return &resp.UserDetail, nil
}