AcquireResult.cs 935 B

123456789101112131415161718192021
  1. using Newtonsoft.Json;
  2. namespace ivf_tl_Operate.Debug
  3. {
  4. /// <summary>
  5. /// acquire/command/release/heartbeat 的统一响应 DTO(对齐 control 端 DebugCommandResult 的 JSON)。
  6. /// acquire 成功时 Result=sessionId 字符串;cultivating/embryoCount 仅 acquire 回带(供调试前培养态确认框)。
  7. /// </summary>
  8. public class AcquireResult
  9. {
  10. [JsonProperty("ok")] public bool Ok { get; set; }
  11. [JsonProperty("result")] public object Result { get; set; }
  12. [JsonProperty("error")] public string Error { get; set; }
  13. [JsonProperty("code")] public string Code { get; set; }
  14. [JsonProperty("cultivating")] public bool Cultivating { get; set; }
  15. [JsonProperty("embryoCount")] public int EmbryoCount { get; set; }
  16. /// <summary>acquire 时 control 把 sessionId 放在 result 字段。</summary>
  17. public string SessionId => Result?.ToString();
  18. }
  19. }