Commit 889359fe by chenxianqi

message body add key

parent 6e023090
Showing with 2 additions and 0 deletions
...@@ -283,6 +283,7 @@ func MessageP2P(message models.Message) { ...@@ -283,6 +283,7 @@ func MessageP2P(message models.Message) {
callbackMessage.FromAccount = message.ToAccount callbackMessage.FromAccount = message.ToAccount
callbackMessage.Timestamp = time.Now().Unix() + 1 callbackMessage.Timestamp = time.Now().Unix() + 1
callbackMessage.ToAccount = message.FromAccount callbackMessage.ToAccount = message.FromAccount
callbackMessage.Key = time.Now().Unix()
callbackMessage.Payload = messageContent callbackMessage.Payload = messageContent
messageJSON, _ := json.Marshal(callbackMessage) messageJSON, _ := json.Marshal(callbackMessage)
messageString := base64.StdEncoding.EncodeToString([]byte(messageJSON)) messageString := base64.StdEncoding.EncodeToString([]byte(messageJSON))
......
...@@ -144,6 +144,7 @@ func appTask() { ...@@ -144,6 +144,7 @@ func appTask() {
message.FromAccount = appAccount message.FromAccount = appAccount
message.ToAccount = contact.FromAccount message.ToAccount = contact.FromAccount
message.BizType = "text" message.BizType = "text"
message.Key = time.Now().Unix()
message.Payload = robotData.TimeoutText message.Payload = robotData.TimeoutText
messageJSON, _ = json.Marshal(message) messageJSON, _ = json.Marshal(message)
messageString = base64.StdEncoding.EncodeToString([]byte(messageJSON)) messageString = base64.StdEncoding.EncodeToString([]byte(messageJSON))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment