From 243f8198ae19bf83772fadcc0f06f1ff05a79265 Mon Sep 17 00:00:00 2001 From: markwang <2951177317@qq.com> Date: Wed, 12 Oct 2022 10:03:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1-=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E8=81=94=E7=B3=BB-=E8=8E=B7=E5=8F=96=E7=BE=A4?= =?UTF-8?q?=E5=8F=91=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=20(#627)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 企业微信-客户联系-统计管理 * 企业微信-客户联系-统计管理 * 企业微信-客户联系-统计管理 * debug * rollback * debug * debug * 获取用户信息 * token * json.Marshal错误输出 * debug * bugfix * 企业微信-通讯录管理相关接口 * 企业微信-通讯录管理 * 企业微信-通讯录管理 * 企业微信-通讯录管理 * 企业微信-[联系我]方式新增和查询 * 企业微信-[联系我]方式新增和获取 * 企业微信-[联系我]方式更新 * 企业微信-[联系我]方式列表、删除 * json.Marshal错误输出 * 已实现接口bug修改 * 历史接口bugfix * 历史接口bugfix * comment * 企业微信:客户联系-消息推送;素材管理-上传图片 * fix * 企业微信-获取群发记录列表 * 历史接口bugfix Co-authored-by: wang.yu --- work/externalcontact/external_user.go | 37 +++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/work/externalcontact/external_user.go b/work/externalcontact/external_user.go index 447dc5491..434f1bbb3 100644 --- a/work/externalcontact/external_user.go +++ b/work/externalcontact/external_user.go @@ -47,23 +47,23 @@ func (r *Client) GetExternalUserList(userID string) ([]string, error) { // ExternalUserDetailResponse 外部联系人详情响应 type ExternalUserDetailResponse struct { util.CommonError - ExternalUser + ExternalContact ExternalUser `json:"external_contact"` + FollowUser []FollowUser `json:"follow_user"` + NextCursor string `json:"next_cursor"` } // ExternalUser 外部联系人 type ExternalUser struct { - ExternalUserID string `json:"external_userid"` - Name string `json:"name"` - Avatar string `json:"avatar"` - Type int64 `json:"type"` - Gender int64 `json:"gender"` - UnionID string `json:"unionid"` - Position string `json:"position"` - CorpName string `json:"corp_name"` - CorpFullName string `json:"corp_full_name"` - ExternalProfile string `json:"external_profile"` - FollowUser []FollowUser `json:"follow_user"` - NextCursor string `json:"next_cursor"` + ExternalUserID string `json:"external_userid"` + Name string `json:"name"` + Avatar string `json:"avatar"` + Type int64 `json:"type"` + Gender int64 `json:"gender"` + UnionID string `json:"unionid"` + Position string `json:"position"` + CorpName string `json:"corp_name"` + CorpFullName string `json:"corp_full_name"` + ExternalProfile string `json:"external_profile"` } // FollowUser 跟进用户(指企业内部用户) @@ -96,7 +96,8 @@ type WechatChannel struct { } // GetExternalUserDetail 获取外部联系人详情 -func (r *Client) GetExternalUserDetail(externalUserID string, nextCursor ...string) (*ExternalUser, error) { +// @see https://developer.work.weixin.qq.com/document/path/92114 +func (r *Client) GetExternalUserDetail(externalUserID string, nextCursor ...string) (*ExternalUserDetailResponse, error) { accessToken, err := r.GetAccessToken() if err != nil { return nil, err @@ -106,12 +107,12 @@ func (r *Client) GetExternalUserDetail(externalUserID string, nextCursor ...stri if err != nil { return nil, err } - var result ExternalUserDetailResponse - err = util.DecodeWithError(response, &result, "get_external_user_detail") + result := &ExternalUserDetailResponse{} + err = util.DecodeWithError(response, result, "get_external_user_detail") if err != nil { return nil, err } - return &result.ExternalUser, nil + return result, nil } // BatchGetExternalUserDetailsRequest 批量获取外部联系人详情请求 @@ -161,6 +162,7 @@ type FollowInfo struct { } // BatchGetExternalUserDetails 批量获取外部联系人详情 +// @see https://developer.work.weixin.qq.com/document/path/92994 func (r *Client) BatchGetExternalUserDetails(request BatchGetExternalUserDetailsRequest) ([]ExternalUserForBatch, error) { accessToken, err := r.GetAccessToken() if err != nil { @@ -195,6 +197,7 @@ type UpdateUserRemarkRequest struct { } // UpdateUserRemark 修改客户备注信息 +// @see https://developer.work.weixin.qq.com/document/path/92115 func (r *Client) UpdateUserRemark(request UpdateUserRemarkRequest) error { accessToken, err := r.GetAccessToken() if err != nil {