StatusDto.cs 711 B

12345678910111213141516171819
  1. using Newtonsoft.Json;
  2. namespace IvfTl.ControlHost
  3. {
  4. /// <summary>
  5. /// control 本地 HTTP /ping、/status 的返回体(阶段1:基础存活 + 现有快照占位)。
  6. /// 监控补全(各舱实时活动/线程心跳/串口借用)在阶段2 扩展。
  7. /// </summary>
  8. public class StatusDto
  9. {
  10. [JsonProperty("ok")] public bool Ok { get; set; }
  11. [JsonProperty("pid")] public int Pid { get; set; }
  12. [JsonProperty("tlSn")] public string TlSn { get; set; } = "";
  13. [JsonProperty("started")] public bool Started { get; set; }
  14. public static StatusDto Ping(int pid, string tlSn) =>
  15. new StatusDto { Ok = true, Pid = pid, TlSn = tlSn ?? "" };
  16. }
  17. }