mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-04 12:52:27 +08:00
企业微信-[联系我]方式更新 (#605)
* 企业微信-客户联系-统计管理 * 企业微信-客户联系-统计管理 * 企业微信-客户联系-统计管理 * debug * rollback * json.Marshal错误输出 * 企业微信-通讯录管理相关接口 * 企业微信-通讯录管理 * 企业微信-通讯录管理 * 企业微信-通讯录管理 * 企业微信-[联系我]方式新增和查询 * 企业微信-[联系我]方式新增和获取 * 企业微信-[联系我]方式更新 Co-authored-by: wang.yu <wangyu@uniondrug.com>
This commit is contained in:
@@ -11,6 +11,8 @@ const (
|
||||
AddContactWayURL = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_contact_way?access_token=%s"
|
||||
// GetContactWayURL 获取企业已配置的「联系我」方式
|
||||
GetContactWayURL = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_contact_way?access_token=%s"
|
||||
// UpdateContactWayURL 更新企业已配置的「联系我」方式
|
||||
UpdateContactWayURL = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/update_contact_way?access_token=%s"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -152,3 +154,45 @@ func (r *Client) GetContactWay(req *GetContactWayRequest) (*GetContactWayRespons
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
type (
|
||||
// UpdateContactWayRequest 更新企业已配置的「联系我」方式请求
|
||||
UpdateContactWayRequest struct {
|
||||
ConfigID string `json:"config_id"`
|
||||
Remark string `json:"remark"`
|
||||
SkipVerify bool `json:"skip_verify"`
|
||||
Style int `json:"style"`
|
||||
State string `json:"state"`
|
||||
User []string `json:"user"`
|
||||
Party []int `json:"party"`
|
||||
ExpiresIn int `json:"expires_in"`
|
||||
ChatExpiresIn int `json:"chat_expires_in"`
|
||||
UnionID string `json:"unionid"`
|
||||
Conclusions ConclusionsRequest `json:"conclusions"`
|
||||
}
|
||||
// UpdateContactWayResponse 更新企业已配置的「联系我」方式响应
|
||||
UpdateContactWayResponse struct {
|
||||
util.CommonError
|
||||
}
|
||||
)
|
||||
|
||||
// UpdateContactWay 更新企业已配置的「联系我」方式
|
||||
// see https://developer.work.weixin.qq.com/document/path/92228
|
||||
func (r *Client) UpdateContactWay(req *UpdateContactWayRequest) (*UpdateContactWayResponse, error) {
|
||||
var (
|
||||
accessToken string
|
||||
err error
|
||||
)
|
||||
if accessToken, err = r.GetAccessToken(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var response []byte
|
||||
if response, err = util.PostJSON(fmt.Sprintf(UpdateContactWayURL, accessToken), req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := &UpdateContactWayResponse{}
|
||||
if err = util.DecodeWithError(response, result, "UpdateContactWay"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user