修复聊天消息不显示最新数据:所有列表查询排序从 created_at DESC 改为 id DESC,记录创建函数显式设置 CreatedAt,后端 v1.2.1 / 前端 v0.3.1
This commit is contained in:
@@ -1291,6 +1291,7 @@ func textMessageFromRecord(record map[string]any, clientInfo MQTTClientInfo) (*T
|
||||
MQTTRemoteHost: clientFields.MQTTRemoteHost,
|
||||
MQTTRemotePort: clientFields.MQTTRemotePort,
|
||||
ContentJSON: common.ContentJSON,
|
||||
CreatedAt: time.Now(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -1401,6 +1402,7 @@ func AppendPacketFieldsFromRecord(record map[string]any, wantType string, client
|
||||
DecryptSuccess: nullableBool(record["decrypt_success"]),
|
||||
DecryptStatus: NullableString(record["decrypt_status"]),
|
||||
ContentJSON: string(contentJSON),
|
||||
CreatedAt: time.Now(),
|
||||
}, MQTTClientRecordFields{
|
||||
MQTTClientID: NullableString(clientInfo.ClientID),
|
||||
MQTTUsername: NullableString(clientInfo.Username),
|
||||
|
||||
Reference in New Issue
Block a user