mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-11 08:12:26 +08:00
fix(work): fix 752 (#753)
fix cannot unmarshal object into Go struct field ExternalUser.external_contact.external_profile of type string
This commit is contained in:
@@ -63,16 +63,16 @@ type ExternalUserDetailResponse struct {
|
|||||||
|
|
||||||
// ExternalUser 外部联系人
|
// ExternalUser 外部联系人
|
||||||
type ExternalUser struct {
|
type ExternalUser struct {
|
||||||
ExternalUserID string `json:"external_userid"`
|
ExternalUserID string `json:"external_userid"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Avatar string `json:"avatar"`
|
Avatar string `json:"avatar"`
|
||||||
Type int64 `json:"type"`
|
Type int64 `json:"type"`
|
||||||
Gender int64 `json:"gender"`
|
Gender int64 `json:"gender"`
|
||||||
UnionID string `json:"unionid"`
|
UnionID string `json:"unionid"`
|
||||||
Position string `json:"position"`
|
Position string `json:"position"`
|
||||||
CorpName string `json:"corp_name"`
|
CorpName string `json:"corp_name"`
|
||||||
CorpFullName string `json:"corp_full_name"`
|
CorpFullName string `json:"corp_full_name"`
|
||||||
ExternalProfile string `json:"external_profile"`
|
ExternalProfile *ExternalProfile `json:"external_profile,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// FollowUser 跟进用户(指企业内部用户)
|
// FollowUser 跟进用户(指企业内部用户)
|
||||||
@@ -104,6 +104,46 @@ type WechatChannel struct {
|
|||||||
Source int `json:"source"`
|
Source int `json:"source"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExternalProfile 外部联系人的自定义展示信息,可以有多个字段和多种类型,包括文本,网页和小程序
|
||||||
|
type ExternalProfile struct {
|
||||||
|
ExternalCorpName string `json:"external_corp_name"`
|
||||||
|
WechatChannels WechatChannels `json:"wechat_channels"`
|
||||||
|
ExternalAttr []ExternalAttr `json:"external_attr"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// WechatChannels 视频号属性。须从企业绑定到企业微信的视频号中选择,可在“我的企业”页中查看绑定的视频号
|
||||||
|
type WechatChannels struct {
|
||||||
|
Nickname string `json:"nickname"`
|
||||||
|
Status int `json:"status"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExternalAttr 属性列表,目前支持文本、网页、小程序三种类型
|
||||||
|
type ExternalAttr struct {
|
||||||
|
Type int `json:"type"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Text *Text `json:"text,omitempty"`
|
||||||
|
Web *Web `json:"web,omitempty"`
|
||||||
|
MiniProgram *MiniProgram `json:"miniprogram,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Text 文本
|
||||||
|
type Text struct {
|
||||||
|
Value string `json:"value"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Web 网页
|
||||||
|
type Web struct {
|
||||||
|
URL string `json:"url"`
|
||||||
|
Title string `json:"title"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MiniProgram 小程序
|
||||||
|
type MiniProgram struct {
|
||||||
|
AppID string `json:"appid"`
|
||||||
|
Pagepath string `json:"pagepath"`
|
||||||
|
Title string `json:"title"`
|
||||||
|
}
|
||||||
|
|
||||||
// GetExternalUserDetail 获取外部联系人详情
|
// GetExternalUserDetail 获取外部联系人详情
|
||||||
// @see https://developer.work.weixin.qq.com/document/path/92114
|
// @see https://developer.work.weixin.qq.com/document/path/92114
|
||||||
func (r *Client) GetExternalUserDetail(externalUserID string, nextCursor ...string) (*ExternalUserDetailResponse, error) {
|
func (r *Client) GetExternalUserDetail(externalUserID string, nextCursor ...string) (*ExternalUserDetailResponse, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user