customer message

This commit is contained in:
jiangyong 2024-07-05 08:07:36 +08:00
parent 1f3492205d
commit 1b8f9cd42c
1 changed files with 3 additions and 0 deletions

View File

@ -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)