Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

外部联系人一些列接口和事件类型完善 #176

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
16 changes: 12 additions & 4 deletions external_contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,20 @@ func (c *WorkwxApp) GetExternalContact(externalUserID string) (*ExternalContactI
return &resp.ExternalContactInfo, nil
}

// BatchListExternalContact 批量获取客户详情
// BatchListExternalContact
//
// Deprecated: 因为批量获取客户详情 https://developer.work.weixin.qq.com/document/path/92994 已经 deprecated UserID参数
// 请使用 BatchListExternalContactsOfUserIDs 代替 为了保证兼容此函数保留
func (c *WorkwxApp) BatchListExternalContact(userID string, cursor string, limit int) (*BatchListExternalContactsResp, error) {
return c.BatchListExternalContactsOfUserIDs([]string{userID}, cursor, limit)
}

// BatchListExternalContactsOfUserIDs 批量获取客户详情 支持多个不同UserID
func (c *WorkwxApp) BatchListExternalContactsOfUserIDs(userID []string, cursor string, limit int) (*BatchListExternalContactsResp, error) {
resp, err := c.execExternalContactBatchList(reqExternalContactBatchList{
UserID: userID,
Cursor: cursor,
Limit: limit,
UseridList: userID,
Cursor: cursor,
Limit: limit,
})
if err != nil {
return nil, err
Expand Down
4 changes: 3 additions & 1 deletion external_contact.md.go

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

8 changes: 5 additions & 3 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,12 @@ type BatchListExternalContactsResp struct {
}

// reqExternalContactBatchList 批量获取客户详情
// https://developer.work.weixin.qq.com/document/path/92994
// 本接口已经支持批量请求 单个 UserID参数已经废弃
type reqExternalContactBatchList struct {
UserID string `json:"userid"`
Cursor string `json:"cursor"`
Limit int `json:"limit"`
UseridList []string `json:"userid_list"`
Cursor string `json:"cursor"`
Limit int `json:"limit"`
}

var _ bodyer = reqExternalContactBatchList{}
Expand Down
24 changes: 21 additions & 3 deletions rx_msg.md.go

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

5 changes: 5 additions & 0 deletions rx_msg_extras.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,11 @@ type EventAddHalfExternalContact interface {

// GetState 添加此用户的「联系我」方式配置的state参数,可用于识别添加此用户的渠道
GetState() string

// GetWelcomeCode 欢迎语code,可用于发送欢迎语
// 当企业微信开启加好友无须验证且人员不主动添加到通讯录,则收到此事件,可以发送欢迎语
// See also: https://developer.work.weixin.qq.com/document/path/92130#%E5%A4%96%E9%83%A8%E8%81%94%E7%B3%BB%E4%BA%BA%E5%85%8D%E9%AA%8C%E8%AF%81%E6%B7%BB%E5%8A%A0%E6%88%90%E5%91%98%E4%BA%8B%E4%BB%B6
GetWelcomeCode() string
}

var _ EventAddHalfExternalContact = (*rxEventAddHalfExternalContact)(nil)
Expand Down
11 changes: 7 additions & 4 deletions user_info.md.go

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