Skip to content

Update msg_audit.go #80

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apis.md.go

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

1 change: 1 addition & 0 deletions docs/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Name|Request Type|Response Type|Access Token|URL|Doc
`execTransferExternalContact`|`reqTransferExternalContact`|`respTransferExternalContact`|+|`POST /cgi-bin/externalcontact/transfer`|[分配成员的客户](https://work.weixin.qq.com/api/doc/90000/90135/92125)
`execGetTransferExternalContactResult`|`reqGetTransferExternalContactResult`|`respGetTransferExternalContactResult`|+|`POST /cgi-bin/externalcontact/get_transfer_result`|[查询客户接替结果](https://work.weixin.qq.com/api/doc/90000/90135/92973)
`execTransferGroupChatExternalContact`|`reqTransferGroupChatExternalContact`|`respTransferGroupChatExternalContact`|+|`POST /cgi-bin/externalcontact/groupchat/transfer`|[离职成员的群再分配](https://work.weixin.qq.com/api/doc/90000/90135/92127)
`execExternalContractGroupChatGet`|`reqGroupChatExternalContact`|`respGetExternalContractGroupChatResult`|+|`POST /cgi-bin/externalcontact/groupchat/get`|[获取客户群详情](https://work.weixin.qq.com/api/doc/90000/90135/92122)

# 应用管理

Expand Down
29 changes: 29 additions & 0 deletions docs/external_contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,32 @@ Name|JSON|Type|Doc
`ChatID`|`chat_id`|`string`| 没能成功继承的群ID
`ErrCode`|`errcode`|`int`| 没能成功继承的群,错误码
`ErrMsg`|`errmsg`|`string`| 没能成功继承的群,错误描述

### `ExternalContractGroupMemberList` 群成员列表

Name|JSON|Type|Doc
:---|:---|:---|:--
`Userid`|`userid`|`string`|
`Type`|`type`|`int`| 成员类型。1 - 企业成员 2 - 外部联系人
`JoinTime`|`join_time`|`int`|
`JoinScene`|`join_scene`|`int`| 入群方式。1 - 由群成员邀请入群(直接邀请入群)2 - 由群成员邀请入群(通过邀请链接入群)3 - 通过扫描群二维码入群
`GroupNickname`|`group_nickname`|`string`| 在群里的昵称
`Name`|`name`|`string`| 名字。仅当 need_name = 1 时返回

### `ExternalContractGroupAdminList` 群管理员列表

Name|JSON|Type|Doc
:---|:---|:---|:--
`Userid`|`userid`|`string`| 群管理员userid

### `ExternalContractGroupChat` 客户群详情

Name|JSON|Type|Doc
:---|:---|:---|:--
`ChatID`|`chat_id`|`string`| 客户群ID
`Name`|`name`|`string`| 群名
`Owner`|`owner`|`string`| 群主ID
`CreateTime`|`create_time`|`int`| 群的创建时间
`Notice`|`notice`|`string`| 群公告
`MemberList`|`member_list`|`[]ExternalContractGroupMemberList`| 群成员列表
`AdminList`|`admin_list`|`[]ExternalContractGroupAdminList`| 群管理员列表
12 changes: 12 additions & 0 deletions external_contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,15 @@ func (c *WorkwxApp) TransferGroupChatExternalContact(chatIDList []string, newOwn
}
return resp.FailedChatList, nil
}

// GetGroupChatExternalContact 获取客户群详情
func (c *WorkwxApp) GetGroupChatExternalContact(chatID string, needName int) (*ExternalContractGroupChat, error) {
resp, err := c.execExternalContractGroupChatGet(reqGroupChatExternalContact{
ChatID: chatID,
NeedName: needName,
})
if err != nil {
return nil, err
}
return &resp.ExternalContractGroupChat, nil
}
38 changes: 38 additions & 0 deletions external_contact.md.go

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

27 changes: 25 additions & 2 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ func (x reqMsgAuditGetGroupChat) intoBody() ([]byte, error) {
type respMsgAuditGetGroupChat struct {
respCommon
Members []struct {
MemberID int `json:"memberid"`
JoinTime int `json:"jointime"`
MemberID string `json:"memberid"`
JoinTime int `json:"jointime"`
} `json:"members"`
RoomName string `json:"roomname"`
Creator string `json:"creator"`
Expand Down Expand Up @@ -891,6 +891,29 @@ type respTransferGroupChatExternalContact struct {
FailedChatList []ExternalContactGroupChatTransferFailed `json:"failed_chat_list"`
}

type reqGroupChatExternalContact struct {
//客户群ID
ChatID string `json:"chat_id"`
//是否需要返回群成员的名字group_chat.member_list.name。0-不返回;1-返回。默认不返回
NeedName int `json:"need_name"`
}

var _ bodyer = reqGroupChatExternalContact{}

func (x reqGroupChatExternalContact) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}

return result, nil
}

type respGetExternalContractGroupChatResult struct {
respCommon
ExternalContractGroupChat `json:"group_chat"`
}

type reqOAGetTemplateDetail struct {
TemplateID string `json:"template_id"`
}
Expand Down
2 changes: 1 addition & 1 deletion msg_audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *WorkwxApp) ListMsgAuditPermitUser(msgAuditEdition MsgAuditEdition) ([]s
// MsgAuditGroupChatMember 获取会话内容存档内部群成员
type MsgAuditGroupChatMember struct {
// MemberID roomid群成员的id,userid
MemberID int
MemberID string
// JoinTime roomid群成员的入群时间
JoinTime time.Time
}
Expand Down