在 AiVideo 中能看到图像

增加了在线状态同步逻辑
This commit is contained in:
2026-01-09 12:30:36 +08:00
parent 3d47c8f009
commit 3351ae739e
31 changed files with 1090 additions and 477 deletions

View File

@@ -0,0 +1,49 @@
using MessagePack;
using System.Collections.Generic;
namespace SHH.Contracts
{
/// <summary>
/// [控制面] 状态全量快照包
/// </summary>
[MessagePackObject]
public class StatusBatchPayload
{
// [新增] 协议类型标识 (人工可读)
// 建议值: "STATUS_BATCH" 或 "设备状态全量包"
[Key(0)]
public string Protocol { get; set; } = "STATUS_BATCH";
[Key(1)]
public List<StatusEventPayload> Items { get; set; }
= new List<StatusEventPayload>();
[Key(2)]
public long Timestamp { get; set; }
}
/// <summary>
/// [控制面] 设备状态变更通知包
/// </summary>
[MessagePackObject]
public class StatusEventPayload
{
[Key(0)]
public string CameraId { get; set; }
/// <summary>
/// true: 上线/活跃, false: 离线/超时
/// </summary>
[Key(1)]
public bool IsOnline { get; set; }
/// <summary>
/// 变更原因 (e.g. "Ping Success", "Frame Timeout")
/// </summary>
[Key(2)]
public string Reason { get; set; }
[Key(3)]
public long Timestamp { get; set; }
}
}