customer message
This commit is contained in:
parent
1f3492205d
commit
1b8f9cd42c
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/smbrave/goutil"
|
||||
"github.com/spf13/cast"
|
||||
"gitlab.batiao8.com/open/gosdk/util"
|
||||
"gitlab.batiao8.com/open/gosdk/wechat/message"
|
||||
|
@ -45,6 +46,7 @@ type CustomerMessage struct {
|
|||
Origin int
|
||||
SendTime int64
|
||||
SyncTime int64
|
||||
Raw string
|
||||
Text *CustomerText
|
||||
Event *CustomerEvent
|
||||
Image *CustomerImage
|
||||
|
@ -313,6 +315,7 @@ func (m *CustomerMessage) From(data map[string]interface{}) {
|
|||
m.ExternalUserid = cast.ToString(data["external_userid"])
|
||||
m.ServicerUserid = cast.ToString(data["servicer_userid"])
|
||||
m.OpenKfid = cast.ToString(data["open_kfid"])
|
||||
m.Raw = goutil.EncodeJSON(data)
|
||||
|
||||
if m.Msgtype == message.MsgTypeEvent {
|
||||
m.parseEvent(data)
|
||||
|
|
Loading…
Reference in New Issue