Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
rudy-tao committed Aug 17, 2022
1 parent 39bb4a4 commit 588fffe
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 162 deletions.
4 changes: 2 additions & 2 deletions apis.md.go

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

4 changes: 2 additions & 2 deletions docs/apis.md
Expand Up @@ -200,7 +200,7 @@ Name|Request Type|Response Type|Access Token|URL|Doc

Name|Request Type|Response Type|Access Token|URL|Doc
:---|------------|-------------|------------|:--|:--
`execTransferCustomer`|`reqTransferCostomer`|`respTransferCustomer`|+|`POST /cgi-bin/externalcontact/transfer_customer`|[在职继承 分配在职成员的客户](https://developer.work.weixin.qq.com/document/path/92125)
`execTransferCustomer`|`reqTransferCustomer`|`respTransferCustomer`|+|`POST /cgi-bin/externalcontact/transfer_customer`|[在职继承 分配在职成员的客户](https://developer.work.weixin.qq.com/document/path/92125)
`execGetTransferCustomerResult`|`reqGetTransferCustomerResult`|`respGetTransferCustomerResult`|+|`POST /cgi-bin/externalcontact/transfer_result`|[在职继承 查询客户接替状态](https://developer.work.weixin.qq.com/document/path/94088)

# 离职继承
Expand All @@ -209,5 +209,5 @@ Name|Request Type|Response Type|Access Token|URL|Doc

Name|Request Type|Response Type|Access Token|URL|Doc
:---|------------|-------------|------------|:--|:--
`execTransferResignedCustomer`|`reqTransferCostomer`|`respTransferCustomer`|+|`POST /cgi-bin/externalcontact/resigned/transfer_customer`|[离职继承 分配离职成员的客户](https://developer.work.weixin.qq.com/document/path/94081)
`execTransferResignedCustomer`|`reqTransferCustomer`|`respTransferCustomer`|+|`POST /cgi-bin/externalcontact/resigned/transfer_customer`|[离职继承 分配离职成员的客户](https://developer.work.weixin.qq.com/document/path/94081)
`execGetTransferResignedCustomerResult`|`reqGetTransferCustomerResult`|`respGetTransferCustomerResult`|+|`POST /cgi-bin/externalcontact/resigned/transfer_result`|[离职继承 查询客户接替状态](https://developer.work.weixin.qq.com/document/path/94082)
12 changes: 6 additions & 6 deletions docs/external_contact.md
Expand Up @@ -251,7 +251,7 @@ Name|JSON|Type|Doc
`IsTemp`|`is_temp`|`bool`| 是否临时会话模式,true表示使用临时会话模式,默认为false
`ExpiresIn`|`expires_in`|`int`| 临时会话二维码有效期,以秒为单位。该参数仅在is_temp为true时有效,默认7天,最多为14天
`ChatExpiresIn`|`chat_expires_in`|`int`| 临时会话有效期,以秒为单位。该参数仅在is_temp为true时有效,默认为添加好友后24小时,最多为14天
`Unionid`|`unionid`|`string`| 可进行临时会话的客户unionid,该参数仅在is_temp为true时有效,如不指定则不进行限制
`UnionID`|`unionid`|`string`| 可进行临时会话的客户UnionID,该参数仅在is_temp为true时有效,如不指定则不进行限制
`Conclusions`|`conclusions`|`Conclusions`| 结束语,会话结束时自动发送给客户,可参考“结束语定义”,仅在is_temp为true时有效,<https://developer.work.weixin.qq.com/document/path/92572#%E7%BB%93%E6%9D%9F%E8%AF%AD%E5%AE%9A%E4%B9%89>

### `Conclusions` 结束语,会话结束时自动发送给客户
Expand All @@ -261,7 +261,7 @@ Name|JSON|Type|Doc
`Text`|`text`|`Text`| 文本消息
`Image`|`image`|`Image`| 图片
`Link`|`link`|`Link`| 链接
`Miniprogram`|`miniprogram`|`Miniprogram`| 小程序
`MiniProgram`|`miniprogram`|`MiniProgram`| 小程序

### `Text` 结束语,会话结束时自动发送给客户

Expand All @@ -285,13 +285,13 @@ Name|JSON|Type|Doc
`Desc`|`desc`|`string`| 图文消息的描述,最长为512字节
`URL`|`url`|`string`| 图文消息的链接

### `Miniprogram` 结束语,会话结束时自动发送给客户
### `MiniProgram` 结束语,会话结束时自动发送给客户

Name|JSON|Type|Doc
:---|:---|:---|:--
`Title`|`title`|`string`| 小程序消息标题,最长为64字节
`PicMediaID`|`pic_media_id`|`string`| 小程序消息封面的mediaid,封面图建议尺寸为520*416
`Appid`|`appid`|`string`| 小程序appid,必须是关联到企业的小程序应用
`AppID`|`appid`|`string`| 小程序appid,必须是关联到企业的小程序应用
`Page`|`page`|`string`| 小程序page路径

### `reqListContactWayExternalContact` 获取企业已配置的「联系我」列表请求参数
Expand All @@ -307,7 +307,7 @@ Name|JSON|Type|Doc

Name|JSON|Type|Doc
:---|:---|:---|:--
`ConfigId`|`config_id`|`string`| 企业联系方式的配置id
`ConfigID`|`config_id`|`string`| 企业联系方式的配置id
`Remark`|`remark`|`string`| 联系方式的备注信息,不超过30个字符,将覆盖之前的备注
`SkipVerify`|`skip_verify`|`bool`| 外部客户添加时是否无需验证
`Style`|`style`|`int`| 样式,只针对“在小程序中联系”的配置生效
Expand All @@ -316,5 +316,5 @@ Name|JSON|Type|Doc
`Party`|`party`|`[]int`| 使用该联系方式的部门id列表,只在type为2时有效
`ExpiresIn`|`expires_in`|`int`| 临时会话二维码有效期,以秒为单位。该参数仅在is_temp为true时有效,默认7天,最多为14天
`ChatExpiresIn`|`chat_expires_in`|`int`| 临时会话有效期,以秒为单位。该参数仅在is_temp为true时有效,默认为添加好友后24小时,最多为14天
`Unionid`|`unionid`|`string`| 可进行临时会话的客户unionid,该参数仅在is_temp为true时有效,如不指定则不进行限制
`UnionID`|`unionid`|`string`| 可进行临时会话的客户UnionID,该参数仅在is_temp为true时有效,如不指定则不进行限制
`Conclusions`|`conclusions`|`Conclusions`| 结束语,会话结束时自动发送给客户,可参考“结束语定义”,仅在is_temp为true时有效,<https://developer.work.weixin.qq.com/document/path/92572#%E7%BB%93%E6%9D%9F%E8%AF%AD%E5%AE%9A%E4%B9%89>
54 changes: 27 additions & 27 deletions external_contact.go
Expand Up @@ -156,8 +156,8 @@ func (c *WorkwxApp) GetTransferExternalContactResult(externalUserID, handoverUse
return &externalContactTransferResult, nil
}

// TransferGroupChatExternalContact 离职成员的群再分配
func (c *WorkwxApp) TransferGroupChatExternalContact(chatIDList []string, newOwner string) ([]ExternalContactGroupChatTransferFailed, error) {
// ExternalContactTransferGroupChat 离职成员的群再分配
func (c *WorkwxApp) ExternalContactTransferGroupChat(chatIDList []string, newOwner string) ([]ExternalContactGroupChatTransferFailed, error) {
resp, err := c.execTransferGroupChatExternalContact(reqTransferGroupChatExternalContact{
ChatIDList: chatIDList,
NewOwner: newOwner,
Expand All @@ -172,7 +172,7 @@ func (c *WorkwxApp) TransferGroupChatExternalContact(chatIDList []string, newOwn
// 一次最多转移100个客户
// 为保障客户服务体验,90个自然日内,在职成员的每位客户仅可被转接2次
func (c *WorkwxApp) TransferCustomer(handoverUserId, takeoverUserId string, externalUserIds []string) (TransferCustomerResult, error) {
resp, err := c.execTransferCustomer(reqTransferCostomer{
resp, err := c.execTransferCustomer(reqTransferCustomer{
HandoverUserid: handoverUserId,
TakeoverUserid: takeoverUserId,
ExternalUserid: externalUserIds,
Expand Down Expand Up @@ -205,8 +205,8 @@ func (c *WorkwxApp) GetTransferCustomerResult(handoverUserId, takeoverUserId, cu

type CustomerTransferResult struct {
Customer []struct {
// ExternalUserid 转接客户的外部联系人userid
ExternalUserid string `json:"external_userid"`
// ExternalUserID 转接客户的外部联系人userid
ExternalUserID string `json:"external_userid"`
// Status 接替状态, 1-接替完毕 2-等待接替 3-客户拒绝 4-接替成员客户达到上限 5-无接替记录
Status int `json:"status"`
// TakeoverTime 接替客户的时间,如果是等待接替状态,则为未来的自动接替时间
Expand All @@ -216,10 +216,10 @@ type CustomerTransferResult struct {
NextCursor string `json:"next_cursor"`
}

// TransferResignedCustomer 离职继承 分配离职成员的客户
// ResignedTransferCustomer 离职继承 分配离职成员的客户
// 一次最多转移100个客户
func (c *WorkwxApp) TransferResignedCustomer(handoverUserId, takeoverUserId string, externalUserIds []string) (TransferCustomerResult, error) {
resp, err := c.execTransferResignedCustomer(reqTransferCostomer{
func (c *WorkwxApp) ResignedTransferCustomer(handoverUserId, takeoverUserId string, externalUserIds []string) (TransferCustomerResult, error) {
resp, err := c.execTransferResignedCustomer(reqTransferCustomer{
HandoverUserid: handoverUserId,
TakeoverUserid: takeoverUserId,
ExternalUserid: externalUserIds,
Expand All @@ -243,8 +243,8 @@ func (c *WorkwxApp) GetTransferResignedCustomerResult(handoverUserId, takeoverUs
return &result, nil
}

// ListFollowUserExternalContact 获取配置了客户联系功能的成员列表
func (c *WorkwxApp) ListFollowUserExternalContact() (*ExternalContactFollowUserList, error) {
// ExternalContactListFollowUser 获取配置了客户联系功能的成员列表
func (c *WorkwxApp) ExternalContactListFollowUser() (*ExternalContactFollowUserList, error) {
resp, err := c.execListFollowUserExternalContact(reqListFollowUserExternalContact{})
if err != nil {
return nil, err
Expand All @@ -253,8 +253,8 @@ func (c *WorkwxApp) ListFollowUserExternalContact() (*ExternalContactFollowUserL
return &resp.ExternalContactFollowUserList, nil
}

// AddContactExternalContact 配置客户联系「联系我」方式
func (c *WorkwxApp) AddContactExternalContact(t int, scene int, style int, remark string, skipVerify bool, state string, user []string, party []int, isTemp bool, expiresIn int, chatExpiresIn int, unionid string, conclusions Conclusions) (*AddContactExternalContact, error) {
// ExternalContactAddContact 配置客户联系「联系我」方式
func (c *WorkwxApp) ExternalContactAddContact(t int, scene int, style int, remark string, skipVerify bool, state string, user []string, party []int, isTemp bool, expiresIn int, chatExpiresIn int, unionID string, conclusions Conclusions) (*ExternalContactAddContact, error) {
resp, err := c.execAddContactExternalContact(
reqAddContactExternalContact{
ExternalContactWay{
Expand All @@ -269,19 +269,19 @@ func (c *WorkwxApp) AddContactExternalContact(t int, scene int, style int, remar
IsTemp: isTemp,
ExpiresIn: expiresIn,
ChatExpiresIn: chatExpiresIn,
Unionid: unionid,
UnionID: unionID,
Conclusions: conclusions,
},
})
if err != nil {
return nil, err
}

return &resp.AddContactExternalContact, nil
return &resp.ExternalContactAddContact, nil
}

// GetContactWayExternalContact 获取企业已配置的「联系我」方式
func (c *WorkwxApp) GetContactWayExternalContact(configID string) (*ContactWayExternalContact, error) {
// ExternalContactGetContactWay 获取企业已配置的「联系我」方式
func (c *WorkwxApp) ExternalContactGetContactWay(configID string) (*ExternalContactContactWay, error) {
resp, err := c.execGetContactWayExternalContact(reqGetContactWayExternalContact{ConfigID: configID})
if err != nil {
return nil, err
Expand All @@ -290,8 +290,8 @@ func (c *WorkwxApp) GetContactWayExternalContact(configID string) (*ContactWayEx
return &resp.ContactWay, nil
}

// ListContactWayChatExternalContact 获取企业已配置的「联系我」列表
func (c *WorkwxApp) ListContactWayChatExternalContact(startTime int, endTime int, cursor string, limit int) (*ListContactWayChatExternalContact, error) {
// ExternalContactListContactWayChat 获取企业已配置的「联系我」列表
func (c *WorkwxApp) ExternalContactListContactWayChat(startTime int, endTime int, cursor string, limit int) (*ExternalContactListContactWayChat, error) {
resp, err := c.execListContactWayChatExternalContact(reqListContactWayExternalContact{
StartTime: startTime,
EndTime: endTime,
Expand All @@ -302,13 +302,13 @@ func (c *WorkwxApp) ListContactWayChatExternalContact(startTime int, endTime int
return nil, err
}

return &resp.ListContactWayChatExternalContact, nil
return &resp.ExternalContactListContactWayChat, nil
}

// UpdateContactWayExternalContact 更新企业已配置的「联系我」成员配置
func (c *WorkwxApp) UpdateContactWayExternalContact(configId string, remark string, skipVerify bool, style int, state string, user []string, party []int, expiresIn int, chatExpiresIn int, unionid string, conclusions Conclusions) error {
// ExternalContactUpdateContactWay 更新企业已配置的「联系我」成员配置
func (c *WorkwxApp) ExternalContactUpdateContactWay(configId string, remark string, skipVerify bool, style int, state string, user []string, party []int, expiresIn int, chatExpiresIn int, unionid string, conclusions Conclusions) error {
_, err := c.execUpdateContactWayExternalContact(reqUpdateContactWayExternalContact{
ConfigId: configId,
ConfigID: configId,
Remark: remark,
SkipVerify: skipVerify,
Style: style,
Expand All @@ -317,22 +317,22 @@ func (c *WorkwxApp) UpdateContactWayExternalContact(configId string, remark stri
Party: party,
ExpiresIn: expiresIn,
ChatExpiresIn: chatExpiresIn,
Unionid: unionid,
UnionID: unionid,
Conclusions: conclusions,
})

return err
}

// DelContactWayExternalContact 删除企业已配置的「联系我」方式
func (c *WorkwxApp) DelContactWayExternalContact(configID string) error {
// ExternalContactDelContactWay 删除企业已配置的「联系我」方式
func (c *WorkwxApp) ExternalContactDelContactWay(configID string) error {
_, err := c.execDelContactWayExternalContact(reqDelContactWayExternalContact{ConfigID: configID})

return err
}

// CloseTempChatExternalContact 结束临时会话
func (c *WorkwxApp) CloseTempChatExternalContact(userID, externalUserID string) error {
// ExternalContactCloseTempChat 结束临时会话
func (c *WorkwxApp) ExternalContactCloseTempChat(userID, externalUserID string) error {
_, err := c.execCloseTempChatExternalContact(reqCloseTempChatExternalContact{
UserID: userID,
ExternalUserID: externalUserID,
Expand Down
25 changes: 12 additions & 13 deletions external_contact.md.go

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

0 comments on commit 588fffe

Please sign in to comment.