diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/IotConstants.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/IotConstants.java
new file mode 100644
index 000000000..5927f44b9
--- /dev/null
+++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/IotConstants.java
@@ -0,0 +1,38 @@
+package cn.iocoder.yudao.module.iot.enums;
+
+/**
+ * Iot 常量
+ *
+ * @author 芋道源码
+ */
+public interface IotConstants {
+
+ /**
+ * 获取设备表名
+ *
+ * 格式为 device_{productKey}_{deviceName}
+ */
+ String DEVICE_TABLE_NAME_FORMAT = "device_%s_%s";
+
+ /**
+ * 获取产品属性超级表名 - 网关子设备
+ *
+ * 格式为 gateway_sub_{productKey}
+ */
+ String GATEWAY_SUB_STABLE_NAME_FORMAT = "gateway_sub_%s";
+
+ /**
+ * 获取产品属性超级表名 - 网关
+ *
+ * 格式为 gateway_{productKey}
+ */
+ String GATEWAY_STABLE_NAME_FORMAT = "gateway_%s";
+
+ /**
+ * 获取产品属性超级表名 - 设备
+ *
+ * 格式为 device_{productKey}
+ */
+ String DEVICE_STABLE_NAME_FORMAT = "device_%s";
+
+}
\ No newline at end of file
diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDeviceDataController.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDeviceDataController.java
index ac2ec5cf7..72fdda8c8 100644
--- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDeviceDataController.java
+++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDeviceDataController.java
@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.iot.controller.admin.device;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
-import cn.iocoder.yudao.module.iot.controller.admin.device.vo.deviceData.IotDeviceDataReqVO;
+import cn.iocoder.yudao.module.iot.controller.admin.device.vo.deviceData.IotDeviceDataPageReqVO;
import cn.iocoder.yudao.module.iot.controller.admin.device.vo.deviceData.IotDeviceDataRespVO;
import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDeviceDataDO;
import cn.iocoder.yudao.module.iot.controller.admin.device.vo.deviceData.IotTimeDataRespVO;
@@ -31,19 +31,17 @@ public class IotDeviceDataController {
@Resource
private IotDeviceDataService deviceDataService;
- // TODO @haohao:是不是叫 get-latest 就好了。因为 data 已经在 url 里了哈
- @GetMapping("/latest-data")
+ @GetMapping("/latest")
@Operation(summary = "获取设备属性最新数据")
- public CommonResult> getDevicePropertiesLatestData(@Valid IotDeviceDataReqVO deviceDataReqVO) {
- List list = deviceDataService.getDevicePropertiesLatestData(deviceDataReqVO);
+ public CommonResult> getLatestDeviceProperties(@Valid IotDeviceDataPageReqVO deviceDataReqVO) {
+ List list = deviceDataService.getLatestDeviceProperties(deviceDataReqVO);
return success(BeanUtils.toBean(list, IotDeviceDataRespVO.class));
}
- // TODO @haohao:是不是叫 /history-data => page
- @GetMapping("/history-data")
+ @GetMapping("/history")
@Operation(summary = "获取设备属性历史数据")
- public CommonResult> getDevicePropertiesHistoryData(@Valid IotDeviceDataReqVO deviceDataReqVO) {
- PageResult