OperationMessage.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. package com.zswl.dataservice.domain.mqtt;
  2. import com.zswl.dataservice.domain.base.SuperEntity;
  3. import com.zswl.dataservice.type.OperationType;
  4. import io.swagger.v3.oas.annotations.media.Schema;
  5. import lombok.AllArgsConstructor;
  6. import lombok.Data;
  7. import lombok.NoArgsConstructor;
  8. import org.springframework.data.mongodb.core.index.Indexed;
  9. import org.springframework.data.mongodb.core.mapping.Document;
  10. import java.util.Date;
  11. /**
  12. * 指令数据
  13. *
  14. * @author TRX
  15. * @date 2024/5/21
  16. */
  17. @Data
  18. @Document
  19. @NoArgsConstructor
  20. @AllArgsConstructor
  21. public class OperationMessage extends SuperEntity {
  22. @Schema(description = "mqtt服务器消息ID")
  23. private String messageId;
  24. @Schema(description = "topic")
  25. private String topic;
  26. @Schema(description = "终端ID")
  27. private String clientId;
  28. @Schema(description = "业务生成的ID")
  29. private String dataId;
  30. @Schema(description = "消息内容")
  31. private Object data;
  32. @Schema(description = "ttl时间(毫秒数)")
  33. private Long ttlTime;
  34. @Schema(description = "发送时间")
  35. private Long sendTime;
  36. @Schema(description = "接收的消息是否超时")
  37. private Boolean isTimeOut;
  38. @Schema(description = "处理标记,判断用那个业务方法处理")
  39. private String event;
  40. //------------------------关联的消息
  41. @Schema(description = "消息的类型")
  42. private String messageClass;
  43. @Schema(description = "关于的设备信息")
  44. private DeviceInfo deviceInfo;
  45. @Schema(description = "设备ID")
  46. private String deviceId;
  47. @Schema(description = "关于的网关信息")
  48. private GateWayInfo gateWayInfo;
  49. @Schema(description = "网关ID")
  50. private String gateWayId;
  51. @Schema(description = "消息创建时间")
  52. private String time;
  53. @Schema(description = "mqtt消息类型: 发送 接收")
  54. OperationType operationType;
  55. @Indexed(expireAfterSeconds = 0)
  56. private Date ttl;
  57. // --------------------- 消息处理结果信息 start -------------------
  58. @Schema(description = "是否收到信息")
  59. private Boolean isReceive;
  60. @Schema(description = "接收到的时间")
  61. private Long receiveTime;
  62. @Schema(description = "接收到的时间可阅读的")
  63. private String receiveTimeStr;
  64. //-------------------业务处理结果 start----------------
  65. @Schema(description = "是否处理成功")
  66. private Boolean isHandleSuccess;
  67. @Schema(description = "业务结果数据")
  68. private Object resultData;
  69. @Schema(description = "处理结果")
  70. private String handleMsg;
  71. @Schema(description = "业务处理的bean")
  72. private String beanName;
  73. @Schema(description = "业务处理的方法")
  74. private String methodName;
  75. //--------------------返回数据 start ------------------
  76. @Schema(description = "是否响应成功")
  77. private Boolean isResult = Boolean.FALSE;
  78. @Schema(description = "返回的topic")
  79. private String reTopic;
  80. @Schema(description = "返回-处理时间")
  81. private Long reTime;
  82. @Schema(description = "返回-处理时间可阅读")
  83. private String reTimeStr;
  84. @Schema(description = "响应结果")
  85. private String reMsg;
  86. @Schema(description = "是否响应成功")
  87. private Boolean reIsSuccess;
  88. }