feat(equipment): 数据补传读取并上传历史数据

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-08-25 20:18:38 +08:00
co-authored by Claude Opus 4.7
parent d59aad4f44
commit 3dea0382f7
2 changed files with 90 additions and 23 deletions
+12
View File
@@ -457,6 +457,18 @@ class LeFuService {
})
}
/**
* 读取设备端指定用户的历史测量数据(数据补传)
* 请求该用户的历史记录,结果通过回调返回
*/
fetchHistoryData(userId: string, cb?: (list: any[]) => void): void {
if (!this._activeProtocol) return
this._activeProtocol.dataFetchHistoryData({ userID: userId }, (res: any) => {
console.log(TAG, 'dataFetchHistoryData:', res)
cb?.(res ?? [])
})
}
// ─── 私有:保活与重连 ───────────────────────
/** 启动保活心跳:文档建议每 10s 发送一次 keepAlive,防止设备主动断开 */
private _startKeepAlive(): void {