forked from chanxuehong/wechat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resp.go
38 lines (33 loc) · 930 Bytes
/
resp.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
package dkf
import (
"gopkg.in/chanxuehong/wechat.v2/mp/core"
)
const (
MsgTypeTransferCustomerService core.MsgType = "transfer_customer_service" // 将消息转发到多客服
)
// 将消息转发到多客服消息
type TransferToCustomerService struct {
XMLName struct{} `xml:"xml" json:"-"`
core.MsgHeader
TransInfo *TransInfo `xml:"TransInfo,omitempty" json:"TransInfo,omitempty"`
}
type TransInfo struct {
KfAccount string `xml:"KfAccount" json:"KfAccount"`
}
// 如果不指定客服则 kfAccount 留空.
func NewTransferToCustomerService(to, from string, timestamp int64, kfAccount string) (msg *TransferToCustomerService) {
msg = &TransferToCustomerService{
MsgHeader: core.MsgHeader{
ToUserName: to,
FromUserName: from,
CreateTime: timestamp,
MsgType: MsgTypeTransferCustomerService,
},
}
if kfAccount != "" {
msg.TransInfo = &TransInfo{
KfAccount: kfAccount,
}
}
return
}