【代码评审】IoT:OTA 的实现
This commit is contained in:
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
// TODO @芋艿:从 server => plugin => device 是否有必要?从阿里云 iot 来看,没有这个功能?!
|
||||
// TODO @芋艿:是不是改成 read 更好?在看看阿里云的 topic 设计
|
||||
/**
|
||||
* IoT 设备【属性】获取 Request DTO
|
||||
*
|
||||
|
||||
@@ -4,6 +4,7 @@ import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
// TODO @芋艿:要不要继承 IotDeviceUpstreamAbstractReqDTO
|
||||
// TODO @芋艿:@haohao:后续其它认证的设计
|
||||
/**
|
||||
* IoT 认证 Emqx 连接 Request DTO
|
||||
*
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
// TODO @芋艿:要写清楚,是来自设备网关,还是设备。
|
||||
/**
|
||||
* IoT 设备【拓扑】添加 Request DTO
|
||||
*/
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.enums;
|
||||
|
||||
/**
|
||||
* Iot 常量
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface IotConstants {
|
||||
|
||||
/**
|
||||
* 获取设备表名
|
||||
* <p>
|
||||
* 格式为 device_{productKey}_{deviceName}
|
||||
*/
|
||||
String DEVICE_TABLE_NAME_FORMAT = "device_%s_%s";
|
||||
|
||||
/**
|
||||
* 获取产品属性超级表名 - 网关子设备
|
||||
* <p>
|
||||
* 格式为 gateway_sub_{productKey}
|
||||
*/
|
||||
String GATEWAY_SUB_STABLE_NAME_FORMAT = "gateway_sub_%s";
|
||||
|
||||
/**
|
||||
* 获取产品属性超级表名 - 网关
|
||||
* <p>
|
||||
* 格式为 gateway_{productKey}
|
||||
*/
|
||||
String GATEWAY_STABLE_NAME_FORMAT = "gateway_%s";
|
||||
|
||||
/**
|
||||
* 获取产品属性超级表名 - 设备
|
||||
* <p>
|
||||
* 格式为 device_{productKey}
|
||||
*/
|
||||
String DEVICE_STABLE_NAME_FORMAT = "device_%s";
|
||||
|
||||
/**
|
||||
* 获取物模型消息记录设备名
|
||||
* <p>
|
||||
* 格式为 thing_model_message_{productKey}_{deviceName}
|
||||
*/
|
||||
String THING_MODEL_MESSAGE_TABLE_NAME_FORMAT = "thing_model_message_%s_%s";
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.iot.enums.device;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
// TODO @芋艿:需要添加对应的 DTO,以及上下行的链路,网关、网关服务、设备等
|
||||
/**
|
||||
* IoT 设备消息标识符枚举
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.iot.enums.plugin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -10,6 +11,7 @@ import java.util.Arrays;
|
||||
*
|
||||
* @author haohao
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum IotPluginDeployTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
@@ -22,24 +24,11 @@ public enum IotPluginDeployTypeEnum implements ArrayValuable<Integer> {
|
||||
* 部署方式
|
||||
*/
|
||||
private final Integer deployType;
|
||||
|
||||
/**
|
||||
* 部署方式名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
IotPluginDeployTypeEnum(Integer deployType, String name) {
|
||||
this.deployType = deployType;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static IotPluginDeployTypeEnum valueOf(Integer deployType) {
|
||||
return Arrays.stream(values())
|
||||
.filter(value -> value.getDeployType().equals(deployType))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.iot.enums.plugin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -10,6 +11,7 @@ import java.util.Arrays;
|
||||
*
|
||||
* @author haohao
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum IotPluginStatusEnum implements ArrayValuable<Integer> {
|
||||
|
||||
@@ -22,35 +24,14 @@ public enum IotPluginStatusEnum implements ArrayValuable<Integer> {
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
IotPluginStatusEnum(Integer status, String name) {
|
||||
this.status = status;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static IotPluginStatusEnum fromState(Integer state) {
|
||||
return Arrays.stream(values())
|
||||
.filter(value -> value.getStatus().equals(state))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static boolean isValidState(Integer state) {
|
||||
return fromState(state) != null;
|
||||
}
|
||||
|
||||
public static boolean contains(Integer status) {
|
||||
return Arrays.stream(values()).anyMatch(e -> e.getStatus().equals(status));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ public enum IotPluginTypeEnum implements ArrayValuable<Integer> {
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
|
||||
/**
|
||||
* 类型名
|
||||
*/
|
||||
@@ -35,15 +34,4 @@ public enum IotPluginTypeEnum implements ArrayValuable<Integer> {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static IotPluginTypeEnum fromType(Integer type) {
|
||||
return Arrays.stream(values())
|
||||
.filter(value -> value.getType().equals(type))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public static boolean isValidType(Integer type) {
|
||||
return fromType(type) != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 联网方式枚举类
|
||||
* IoT 联网方式枚举类
|
||||
*
|
||||
* @author ahh
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品的设备类型
|
||||
* IoT 产品的设备类型
|
||||
*
|
||||
* @author ahh
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品的状态枚举类
|
||||
* IoT 产品的状态枚举类
|
||||
*
|
||||
* @author ahh
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 接入网关协议枚举类
|
||||
* IoT 接入网关协议枚举类
|
||||
*
|
||||
* @author ahh
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 数据校验级别枚举类
|
||||
* IoT 数据校验级别枚举类
|
||||
*
|
||||
* @author ahh
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Iot 告警配置的接收方式枚举
|
||||
* IoT 告警配置的接收方式枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Iot 数据桥接的方向枚举
|
||||
* IoT 数据桥接的方向枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Iot 数据桥接的类型枚举
|
||||
* IoT 数据桥接的类型枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Iot 规则场景的触发类型枚举
|
||||
* IoT 规则场景的触发类型枚举
|
||||
*
|
||||
* 设备触发,定时触发
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Iot 场景触发条件参数的操作符枚举
|
||||
* IoT 场景触发条件参数的操作符枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Iot 场景流转的触发类型枚举
|
||||
* IoT 场景流转的触发类型枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品物模型属性读取类型枚举
|
||||
* IoT 产品物模型属性读取类型枚举
|
||||
*
|
||||
* @author ahh
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Arrays;
|
||||
|
||||
|
||||
/**
|
||||
* IOT 产品物模型参数是输入参数还是输出参数枚举
|
||||
* IoT 产品物模型参数是输入参数还是输出参数枚举
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品物模型服务调用方式枚举
|
||||
* IoT 产品物模型服务调用方式枚举
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品物模型事件类型枚举
|
||||
* IoT 产品物模型事件类型枚举
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品功能(物模型)类型枚举类
|
||||
* IoT 产品功能(物模型)类型枚举类
|
||||
*
|
||||
* @author ahh
|
||||
*/
|
||||
@@ -30,15 +30,6 @@ public enum IotThingModelTypeEnum implements ArrayValuable<Integer> {
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
public static IotThingModelTypeEnum valueOfType(Integer type) {
|
||||
for (IotThingModelTypeEnum value : values()) {
|
||||
if (value.getType().equals(type)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
|
||||
@@ -133,8 +133,8 @@ public class IotDeviceController {
|
||||
public CommonResult<List<IotDeviceRespVO>> getSimpleDeviceList(
|
||||
@RequestParam(value = "deviceType", required = false) Integer deviceType) {
|
||||
List<IotDeviceDO> list = deviceService.getDeviceListByDeviceType(deviceType);
|
||||
return success(convertList(list, device -> // 只返回 id、name 字段
|
||||
new IotDeviceRespVO().setId(device.getId()).setDeviceName(device.getDeviceName())));
|
||||
return success(convertList(list, device -> // 只返回 id、name 字段
|
||||
new IotDeviceRespVO().setId(device.getId()).setDeviceName(device.getDeviceName())));
|
||||
}
|
||||
|
||||
@PostMapping("/import")
|
||||
|
||||
@@ -13,8 +13,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
|
||||
@Schema(description = "管理后台 - IoT 设备分组分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IotDeviceGroupPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分组名字", example = "李四")
|
||||
|
||||
@@ -19,10 +19,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@Tag(name = "管理后台 - IoT OTA 固件")
|
||||
@RestController
|
||||
@RequestMapping("/iot/ota-firmware")
|
||||
@Validated
|
||||
public class IotOtaFirmwareController {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -20,10 +20,10 @@ import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Validated
|
||||
@Tag(name = "管理后台 - IoT OTA 升级记录")
|
||||
@RestController
|
||||
@Tag(name = "管理后台 - OTA 升级记录")
|
||||
@RequestMapping("/iot/ota-upgrade-record")
|
||||
@Validated
|
||||
public class IotOtaUpgradeRecordController {
|
||||
|
||||
@Resource
|
||||
@@ -33,8 +33,7 @@ public class IotOtaUpgradeRecordController {
|
||||
@Operation(summary = "固件升级设备统计")
|
||||
@PreAuthorize("@ss.hasPermission('iot:ota-upgrade-record:query')")
|
||||
@Parameter(name = "firmwareId", description = "固件编号", required = true, example = "1024")
|
||||
public CommonResult<Map<Integer, Long>> getOtaUpgradeRecordStatistics(
|
||||
@RequestParam(value = "firmwareId") Long firmwareId) {
|
||||
public CommonResult<Map<Integer, Long>> getOtaUpgradeRecordStatistics(@RequestParam(value = "firmwareId") Long firmwareId) {
|
||||
return success(upgradeRecordService.getOtaUpgradeRecordStatistics(firmwareId));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Validated
|
||||
@Tag(name = "管理后台 - IoT OTA 升级任务")
|
||||
@RestController
|
||||
@Tag(name = "管理后台 - OTA升级任务")
|
||||
@RequestMapping("/iot/ota-upgrade-task")
|
||||
@Validated
|
||||
public class IotOtaUpgradeTaskController {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Data;
|
||||
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
@Schema(description = "管理后台 - OTA 固件创建 Request VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 固件创建 Request VO")
|
||||
@Data
|
||||
public class IotOtaFirmwareCreateReqVO {
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "管理后台 - OTA 固件分页 Request VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 固件分页 Request VO")
|
||||
public class IotOtaFirmwarePageReqVO extends PageParam {
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ import lombok.Data;
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
@Data
|
||||
@Schema(description = "管理后台 - OTA 固件 Response VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 固件 Response VO")
|
||||
public class IotOtaFirmwareRespVO implements VO {
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Data;
|
||||
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
@Schema(description = "管理后台 - OTA 固件更新 Request VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 固件更新 Request VO")
|
||||
@Data
|
||||
public class IotOtaFirmwareUpdateReqVO {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import lombok.Data;
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
@Data
|
||||
@Schema(description = "管理后台 - OTA 升级记录分页 Request VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 升级记录分页 Request VO")
|
||||
public class IotOtaUpgradeRecordPageReqVO extends PageParam {
|
||||
|
||||
// TODO @li:已经有注解,不用重复注释
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.time.LocalDateTime;
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
@Data
|
||||
@Schema(description = "管理后台 - OTA升级记录 Response VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 升级记录 Response VO")
|
||||
public class IotOtaUpgradeRecordRespVO {
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ import lombok.Data;
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
@Data
|
||||
@Schema(description = "管理后台 - OTA升级任务分页 Request VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 升级任务分页 Request VO")
|
||||
public class IotOtaUpgradeTaskPageReqVO extends PageParam {
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
@Data
|
||||
@Schema(description = "管理后台 - OTA升级任务 Response VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 升级任务 Response VO")
|
||||
public class IotOtaUpgradeTaskRespVO implements VO {
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||
|
||||
@Data
|
||||
@Schema(description = "管理后台 - OTA 升级任务创建/修改 Request VO")
|
||||
@Schema(description = "管理后台 - IoT OTA 升级任务创建/修改 Request VO")
|
||||
public class IotOtaUpgradeTaskSaveReqVO {
|
||||
|
||||
// TODO @li:已经有注解,不用重复注释
|
||||
|
||||
@@ -8,11 +8,12 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
// TODO @haohao:后续需要使用下
|
||||
@Schema(description = "管理后台 - IoT 插件实例分页 Request VO")
|
||||
@Data
|
||||
public class PluginInstancePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "插件主程序id", example = "23738")
|
||||
@Schema(description = "插件主程序编号", example = "23738")
|
||||
private String mainId;
|
||||
|
||||
@Schema(description = "插件id", example = "26498")
|
||||
|
||||
@@ -1,43 +1,34 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.plugin.vo.instance;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
// TODO @haohao:后续需要使用下
|
||||
@Schema(description = "管理后台 - IoT 插件实例 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PluginInstanceRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23864")
|
||||
@ExcelProperty("主键ID")
|
||||
@Schema(description = "主键编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23864")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "插件主程序id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23738")
|
||||
@ExcelProperty("插件主程序id")
|
||||
private String mainId;
|
||||
|
||||
@Schema(description = "插件id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26498")
|
||||
@ExcelProperty("插件id")
|
||||
private Long pluginId;
|
||||
|
||||
@Schema(description = "插件主程序所在ip", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("插件主程序所在ip")
|
||||
private String ip;
|
||||
|
||||
@Schema(description = "插件主程序端口", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("插件主程序端口")
|
||||
private Integer port;
|
||||
|
||||
@Schema(description = "心跳时间,心路时间超过30秒需要剔除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("心跳时间,心路时间超过30秒需要剔除")
|
||||
private Long heartbeatAt;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.iot.controller.admin.product.vo.category;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
|
||||
@Schema(description = "管理后台 - IoT 产品分类分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IotProductCategoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分类名字", example = "王五")
|
||||
|
||||
@@ -8,8 +8,6 @@ import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - IoT 产品分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IotProductPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "产品名称", example = "李四")
|
||||
|
||||
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
|
||||
@Schema(description = "管理后台 - IoT 数据桥梁分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IotDataBridgePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "桥梁名称", example = "赵六")
|
||||
|
||||
@@ -9,7 +9,6 @@ import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - IoT 数据桥梁 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class IotDataBridgeRespVO {
|
||||
|
||||
@Schema(description = "桥梁编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18564")
|
||||
|
||||
@@ -6,9 +6,9 @@ import lombok.Data;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 管理后台 - Iot 统计 Response VO
|
||||
* 管理后台 - IoT 统计 Response VO
|
||||
*/
|
||||
@Schema(description = "管理后台 - Iot 统计 Response VO")
|
||||
@Schema(description = "管理后台 - IoT 统计 Response VO")
|
||||
@Data
|
||||
public class IotStatisticsSummaryRespVO {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* IOT 产品物模型中的参数
|
||||
* IoT 产品物模型中的参数
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
|
||||
@@ -6,13 +6,9 @@ import cn.iocoder.yudao.module.iot.enums.thingmodel.IotThingModelTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - IoT 产品物模型分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IotThingModelPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
|
||||
@@ -23,8 +23,6 @@ import java.util.Set;
|
||||
@TableName(value = "iot_device", autoResultMap = true)
|
||||
@KeySequence("iot_device_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -14,8 +14,6 @@ import lombok.*;
|
||||
@TableName("iot_device_group")
|
||||
@KeySequence("iot_device_group_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -16,8 +16,6 @@ import lombok.*;
|
||||
@TableName(value = "iot_ota_firmware", autoResultMap = true)
|
||||
@KeySequence("iot_ota_firmware_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -17,8 +17,6 @@ import java.time.LocalDateTime;
|
||||
@TableName(value = "iot_ota_upgrade_record", autoResultMap = true)
|
||||
@KeySequence("iot_ota_upgrade_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -18,8 +18,6 @@ import java.util.List;
|
||||
@TableName(value = "iot_ota_upgrade_task", autoResultMap = true)
|
||||
@KeySequence("iot_ota_upgrade_task_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -17,8 +17,6 @@ import lombok.*;
|
||||
@TableName("iot_plugin_config")
|
||||
@KeySequence("iot_plugin_config_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -16,8 +16,6 @@ import java.time.LocalDateTime;
|
||||
@TableName("iot_plugin_instance")
|
||||
@KeySequence("iot_plugin_instance_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -14,8 +14,6 @@ import lombok.*;
|
||||
@TableName("iot_product_category")
|
||||
@KeySequence("iot_product_category_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -14,8 +14,6 @@ import lombok.*;
|
||||
@TableName("iot_product")
|
||||
@KeySequence("iot_product_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -20,8 +20,6 @@ import java.util.List;
|
||||
@TableName("iot_alert_config")
|
||||
@KeySequence("iot_alert_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -18,8 +18,6 @@ import lombok.*;
|
||||
@TableName("iot_alert_record")
|
||||
@KeySequence("iot_alert_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -20,8 +20,6 @@ import lombok.*;
|
||||
@TableName(value = "iot_data_bridge", autoResultMap = true)
|
||||
@KeySequence("iot_data_bridge_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -27,8 +27,6 @@ import java.util.Map;
|
||||
@TableName("iot_rule_scene")
|
||||
@KeySequence("iot_rule_scene_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -74,10 +74,10 @@ public interface IotOtaUpgradeRecordMapper extends BaseMapperX<IotOtaUpgradeReco
|
||||
|
||||
// TODO @li:这里的注释,可以去掉哈
|
||||
/**
|
||||
* 根据分页查询条件获取IOT OTA升级记录的分页结果
|
||||
* 根据分页查询条件获取 OTA升级记录的分页结果
|
||||
*
|
||||
* @param pageReqVO 分页查询请求参数,包含设备名称、任务ID等查询条件
|
||||
* @return 返回分页查询结果,包含符合条件的IOT OTA升级记录列表
|
||||
* @return 返回分页查询结果,包含符合条件的 OTA升级记录列表
|
||||
*/
|
||||
// TODO @li:selectPage 就 ok 拉。
|
||||
default PageResult<IotOtaUpgradeRecordDO> selectUpgradeRecordPage(IotOtaUpgradeRecordPageReqVO pageReqVO) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDevicePropertyDO;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.plugin.IotPluginInstanceDO;
|
||||
|
||||
/**
|
||||
* Iot Redis Key 枚举类
|
||||
* IoT Redis Key 枚举类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Iot 设备相关消息的 Producer
|
||||
* IoT 设备相关消息的 Producer
|
||||
*
|
||||
* @author alwayssuper
|
||||
* @since 2024/12/17 16:35
|
||||
|
||||
@@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.iot.mq.message.IotDeviceMessage;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* IOT 规则场景的场景执行器接口
|
||||
* IoT 规则场景的场景执行器接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.iot.plugin.common.pojo;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
// TODO @芋艿:1)后续考虑,要不要叫 Iot 网关之类的 Response;2)包名 pojo
|
||||
// TODO @芋艿:1)后续考虑,要不要叫 IoT 网关之类的 Response;2)包名 pojo
|
||||
/**
|
||||
* IoT 标准协议响应实体类
|
||||
* <p>
|
||||
|
||||
Reference in New Issue
Block a user