Skip to content

Commit

Permalink
企业微信-客户联系-获取群发记录列表 (#627)
Browse files Browse the repository at this point in the history
* 企业微信-客户联系-统计管理

* 企业微信-客户联系-统计管理

* 企业微信-客户联系-统计管理

* debug

* rollback

* debug

* debug

* 获取用户信息

* token

* json.Marshal错误输出

* debug

* bugfix

* 企业微信-通讯录管理相关接口

* 企业微信-通讯录管理

* 企业微信-通讯录管理

* 企业微信-通讯录管理

* 企业微信-[联系我]方式新增和查询

* 企业微信-[联系我]方式新增和获取

* 企业微信-[联系我]方式更新

* 企业微信-[联系我]方式列表、删除

* json.Marshal错误输出

* 已实现接口bug修改

* 历史接口bugfix

* 历史接口bugfix

* comment

* 企业微信:客户联系-消息推送;素材管理-上传图片

* fix

* 企业微信-获取群发记录列表

* 历史接口bugfix

Co-authored-by: wang.yu <[email protected]>
  • Loading branch information
markwang1992 and wang.yu authored Oct 12, 2022
1 parent 2bc0536 commit 243f819
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions work/externalcontact/external_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 跟进用户(指企业内部用户)
Expand Down Expand Up @@ -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
Expand All @@ -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 批量获取外部联系人详情请求
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 243f819

Please sign in to comment.