-
Notifications
You must be signed in to change notification settings - Fork 147
/
client.go
72 lines (51 loc) · 1.97 KB
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package msgaudit
import (
"github.com/ArtisanCloud/PowerLibs/v2/object"
"github.com/ArtisanCloud/PowerWeChat/v2/src/kernel"
"github.com/ArtisanCloud/PowerWeChat/v2/src/kernel/power"
"github.com/ArtisanCloud/PowerWeChat/v2/src/work/msgAudit/response"
)
type Client struct {
*kernel.BaseClient
}
// 获取会话内容存档开启成员列表
// https://open.work.weixin.qq.com/api/doc/90000/90135/91614
func (comp *Client) GetPermitUsersList(msgType string) (*response.ResponseMsgAuditGetPermitUsers, error) {
result := &response.ResponseMsgAuditGetPermitUsers{}
params := &object.StringMap{}
if msgType != "" {
(*params)["type"] = msgType
}
_, err := comp.HttpPostJson("cgi-bin/msgaudit/get_permit_user_list", params, nil, nil, result)
return result, err
}
// 获取会话同意情况
// https://open.work.weixin.qq.com/api/doc/90000/90135/91782
func (comp *Client) CheckSingleAgree(info []*power.StringMap) (*response.ResponseMsgAuditGetAgreeInfo, error) {
result := &response.ResponseMsgAuditGetAgreeInfo{}
params := &object.HashMap{
"info": info,
}
_, err := comp.HttpPostJson("cgi-bin/msgaudit/check_single_agree", params, nil, nil, result)
return result, err
}
// 获取会话同意情况
// https://open.work.weixin.qq.com/api/doc/90000/90135/91782
func (comp *Client) CheckRoomAgree(roomID string) (*response.ResponseMsgAuditGetAgreeInfo, error) {
result := &response.ResponseMsgAuditGetAgreeInfo{}
params := &object.HashMap{
"roomid": roomID,
}
_, err := comp.HttpPostJson("cgi-bin/msgaudit/check_room_agree?", params, nil, nil, result)
return result, err
}
// 获取会话内容存档内部群信息
// https://open.work.weixin.qq.com/api/doc/90000/90135/92951
func (comp *Client) GroupchatGet(roomID string) (*response.ResponseMsgAuditGetRoom, error) {
result := &response.ResponseMsgAuditGetRoom{}
params := &object.HashMap{
"roomid": roomID,
}
_, err := comp.HttpPostJson("cgi-bin/msgaudit/groupchat/get?", params, nil, nil, result)
return result, err
}