Skip to content

Commit

Permalink
优化ChatMessage数据结构
Browse files Browse the repository at this point in the history
  • Loading branch information
NICEXAI committed Mar 28, 2021
1 parent ff23b7f commit 604b76c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type ChatData struct {

type ChatMessage struct {
Id string // 消息id,消息的唯一标识,企业可以使用此字段进行消息去重。
From string // 消息发送方id。同一企业内容为userid,非相同企业为external_userid。消息如果是机器人发出,也为external_userid。
ToList []string // 消息接收方列表,可能是多个,同一个企业内容为userid,非相同企业为external_userid。
Action string // 消息动作,目前有send(发送消息)/recall(撤回消息)/switch(切换企业日志)三种类型。
Type string // 消息类型
originData []byte // 原始消息对象
Expand Down
2 changes: 2 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func (s *Client) DecryptData(encrypt_random_key string, encryptMsg string) (msg
return msg, err
}
msg.Id = baseMessage.MsgId
msg.From = baseMessage.From
msg.ToList = baseMessage.ToList
msg.Action = baseMessage.Action
msg.Type = baseMessage.MsgType
msg.originData = buf
Expand Down

0 comments on commit 604b76c

Please sign in to comment.