|
|
@@ -0,0 +1,48 @@
|
|
|
+package com.github.microservice.models.iot;
|
|
|
+
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import io.swagger.v3.oas.annotations.Hidden;
|
|
|
+import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
+import jakarta.validation.constraints.NotEmpty;
|
|
|
+import jakarta.validation.constraints.NotNull;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import lombok.Data;
|
|
|
+import lombok.NoArgsConstructor;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 发送消息的参数模型
|
|
|
+ *
|
|
|
+ * @author TRX
|
|
|
+ * @date 2024/9/9
|
|
|
+ */
|
|
|
+@Data
|
|
|
+@AllArgsConstructor
|
|
|
+@NoArgsConstructor
|
|
|
+public class IotSendParam {
|
|
|
+
|
|
|
+ @Schema(description = "标识数据ID, 不传自动生成")
|
|
|
+ private String dataId;
|
|
|
+
|
|
|
+ @Schema(description = "用户ID")
|
|
|
+ @Hidden
|
|
|
+ private String userId;
|
|
|
+
|
|
|
+ @Schema(description = "标识符,如:ConsumTransactions")
|
|
|
+ @NotEmpty(message = "identifier不能为空")
|
|
|
+ private String identifier;
|
|
|
+
|
|
|
+ @NotEmpty(message = "deviceId不能为空")
|
|
|
+ @Schema(description = "设备ID")
|
|
|
+ private String deviceId;
|
|
|
+
|
|
|
+ @NotNull(message = "data不能为空")
|
|
|
+ @Schema(description = "数据信息")
|
|
|
+ private JSONObject data;
|
|
|
+
|
|
|
+ @Schema(description = "消息过期时间", defaultValue = "5000")
|
|
|
+ private Long ttl = 5000l;
|
|
|
+
|
|
|
+ @Schema(description = "是否是模拟数据", defaultValue = "false")
|
|
|
+ private Boolean isImitate = Boolean.FALSE;
|
|
|
+
|
|
|
+}
|