@@ -46,6 +46,7 @@ type SessionMessage struct {
Content json.RawMessage `gorm:"type:json"`
IsRead BitBool
Received BitBool
+ SentAt time.Time
}
func (*Session) TableName() string {
@@ -221,6 +221,7 @@ func (c *Client) saveMessage(messageId string, messageType int8, content *Chatin
ContentType: content.PayloadType,
Content: payload,
IsRead: false,
+ SentAt: time.UnixMilli(content.SendTime),
})
@@ -49,6 +49,7 @@ type (
Receiver string `json:"receiver"`
PayloadType ChatingContentType `json:"payloadType"`
Payload any `json:"payload"`
+ SendTime int64 `json:"sendTime"`
// NotificationContent to client notice message