1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-08 06:32:27 +08:00
This commit is contained in:
wind
2024-09-27 15:44:19 +08:00
parent 06c225c351
commit 4a4339fc32
10 changed files with 394 additions and 287 deletions

View File

@@ -38,59 +38,10 @@ type UserInfo struct {
FollowInfo FollowInfo `json:"follow_info"` //企业成员客户跟进人信息可以参考获取客户详情但标签信息只会返回企业标签和规则组标签的tag_id个人标签将不再返回
}
type ExternalContact struct {
ExternalUserid string `json:"external_userid"`
Name string `json:"name"`
Position string `json:"position"`
Avatar string `json:"avatar"`
CorpName string `json:"corp_name"`
CorpFullName string `json:"corp_full_name"`
Type int `json:"type"`
Gender int `json:"gender"`
Unionid string `json:"unionid"`
ExternalProfile struct {
ExternalAttr []struct {
Type int `json:"type"`
Name string `json:"name"`
Text struct {
Value string `json:"value"`
} `json:"text,omitempty"`
Web struct {
Url string `json:"url"`
Title string `json:"title"`
} `json:"web,omitempty"`
Miniprogram struct {
Appid string `json:"appid"`
Pagepath string `json:"pagepath"`
Title string `json:"title"`
} `json:"miniprogram,omitempty"`
} `json:"external_attr"`
} `json:"external_profile,omitempty"`
}
type FollowInfo struct {
Userid string `json:"userid"`
Remark string `json:"remark"`
Description string `json:"description"`
Createtime int `json:"createtime"`
TagId []string `json:"tag_id"` //批量获取时才有
Tags []struct {
GroupName string `json:"group_name"`
TagName string `json:"tag_name"`
TagId string `json:"tag_id,omitempty"`
Type int `json:"type"`
} `json:"tags,omitempty"` //单独获取时才有
RemarkCorpName string `json:"remark_corp_name,omitempty"`
RemarkMobiles []string `json:"remark_mobiles,omitempty"`
OperUserid string `json:"oper_userid"`
AddWay int `json:"add_way"`
State string `json:"state,omitempty"`
}
//GetUseridList 获取我的客户列表
// GetUseridList 获取我的客户列表
func (tpl *Client) GetUseridList(myUserid string) (externalUserid []string, err error) {
var accessToken string
accessToken, err = tpl.ctx.GetAccessToken()
accessToken, err = tpl.GetAccessToken()
if err != nil {
return
}
@@ -113,7 +64,7 @@ func (tpl *Client) GetUseridList(myUserid string) (externalUserid []string, err
return
}
//GetUseridList 获取我的全部客户列表及详情
// GetUseridList 获取我的全部客户列表及详情
func (tpl *Client) GetQyUserInfoList(qyUserid []string) ([]UserInfo, error) {
var userInfoList []UserInfo
var req ReqGetByUser
@@ -134,7 +85,7 @@ func (tpl *Client) GetQyUserInfoList(qyUserid []string) ([]UserInfo, error) {
return userInfoList, nil
}
//GetUserInfoAndAllFollow 获取客户详情以及全部跟进人
// GetUserInfoAndAllFollow 获取客户详情以及全部跟进人
func (tpl *Client) GetUserInfoAndAllFollow(userid string) (OneUser, error) {
var result, res OneUser
var err error
@@ -155,10 +106,10 @@ func (tpl *Client) GetUserInfoAndAllFollow(userid string) (OneUser, error) {
return result, nil
}
//GetUserInfo 获取客户详情
// GetUserInfo 获取客户详情
func (tpl *Client) GetUserInfo(externalUserid string, cursor ...string) (result OneUser, err error) {
var accessToken string
accessToken, err = tpl.ctx.GetAccessToken()
accessToken, err = tpl.GetAccessToken()
if err != nil {
return
}
@@ -183,10 +134,10 @@ func (tpl *Client) GetUserInfo(externalUserid string, cursor ...string) (result
return
}
//GetUserInfoListByUserId 批量获取客户详情
// GetUserInfoListByUserId 批量获取客户详情
func (tpl *Client) GetUserInfoListByUserIds(req ReqGetByUser) (userList []UserInfo, nextCursor string, err error) {
var accessToken string
accessToken, err = tpl.ctx.GetAccessToken()
accessToken, err = tpl.GetAccessToken()
if err != nil {
return
}