修复聊天消息不显示最新数据:所有列表查询排序从 created_at DESC 改为 id DESC,记录创建函数显式设置 CreatedAt,后端 v1.2.1 / 前端 v0.3.1
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (s *Store) InsertDiscardDetails(record map[string]any, raw []byte, clientInfo MQTTClientInfo) error {
|
||||
@@ -34,6 +35,7 @@ func discardDetailsFromRecord(record map[string]any, raw []byte, clientInfo MQTT
|
||||
MQTTRemoteAddr: NullableStringValue(clientInfo.RemoteAddr),
|
||||
MQTTRemoteHost: NullableStringValue(clientInfo.RemoteHost),
|
||||
MQTTRemotePort: NullableStringValue(clientInfo.RemotePort),
|
||||
CreatedAt: time.Now(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user