OperationLogMessage.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using Newtonsoft.Json;
  2. namespace Aivfo.OperationLog
  3. {
  4. /// <summary>
  5. /// 操作日志消息 —— 字段对齐 Kafka topic tl-oplog 的 JSON schema(camelCase),
  6. /// 与 Java OperationLogMessage / aivfo-oplog 消费端一致。
  7. /// </summary>
  8. public sealed class OperationLogMessage
  9. {
  10. /// <summary>全链路串联 ID</summary>
  11. [JsonProperty("traceId")]
  12. public string TraceId { get; set; }
  13. /// <summary>父子调用链 ID</summary>
  14. [JsonProperty("parentId")]
  15. public string ParentId { get; set; }
  16. /// <summary>操作时间(epoch 毫秒)</summary>
  17. [JsonProperty("time")]
  18. public long Time { get; set; }
  19. /// <summary>端/服务(operate / front …)</summary>
  20. [JsonProperty("project")]
  21. public string Project { get; set; }
  22. /// <summary>功能模块(可读:对焦 / 串口 …)</summary>
  23. [JsonProperty("module")]
  24. public string Module { get; set; }
  25. /// <summary>操作(可读:一键标定 / 打开端口 …)</summary>
  26. [JsonProperty("operation")]
  27. public string Operation { get; set; }
  28. /// <summary>操作者(登录用户 / 系统 / 设备 SN)</summary>
  29. [JsonProperty("operator")]
  30. public string Operator { get; set; }
  31. /// <summary>输入(JSON 串;大对象只记关键信息)</summary>
  32. [JsonProperty("input")]
  33. public string Input { get; set; }
  34. /// <summary>输出(JSON 串;同上)</summary>
  35. [JsonProperty("output")]
  36. public string Output { get; set; }
  37. /// <summary>结果(成功 / 失败)</summary>
  38. [JsonProperty("result")]
  39. public string Result { get; set; }
  40. /// <summary>报错(消息 + 堆栈摘要)</summary>
  41. [JsonProperty("error")]
  42. public string Error { get; set; }
  43. /// <summary>耗时(毫秒)</summary>
  44. [JsonProperty("elapsedMs")]
  45. public long? ElapsedMs { get; set; }
  46. /// <summary>级别(INFO 操作级 / DEBUG 调试级)</summary>
  47. [JsonProperty("level")]
  48. public string Level { get; set; }
  49. /// <summary>舱号(消费端为 Integer)</summary>
  50. [JsonProperty("houseSn")]
  51. public int? HouseSn { get; set; }
  52. /// <summary>well 号</summary>
  53. [JsonProperty("wellSn")]
  54. public int? WellSn { get; set; }
  55. /// <summary>培养箱 SN</summary>
  56. [JsonProperty("tlSn")]
  57. public string TlSn { get; set; }
  58. /// <summary>来源主机</summary>
  59. [JsonProperty("host")]
  60. public string Host { get; set; }
  61. }
  62. }