Commit 911c8c74615910f8ce276c61ff10511737b2fec5
1 parent
39aaeaa2
【功能修改】IoT:完善设备详情的属性展示
Showing
2 changed files
with
5 additions
and
15 deletions
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDevicePropertyController.java
| @@ -6,7 +6,6 @@ import cn.hutool.core.lang.Assert; | @@ -6,7 +6,6 @@ import cn.hutool.core.lang.Assert; | ||
| 6 | import cn.hutool.core.util.StrUtil; | 6 | import cn.hutool.core.util.StrUtil; |
| 7 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 7 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | -import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 10 | import cn.iocoder.yudao.module.iot.controller.admin.device.vo.data.IotDevicePropertyHistoryPageReqVO; | 9 | import cn.iocoder.yudao.module.iot.controller.admin.device.vo.data.IotDevicePropertyHistoryPageReqVO; |
| 11 | import cn.iocoder.yudao.module.iot.controller.admin.device.vo.data.IotDevicePropertyRespVO; | 10 | import cn.iocoder.yudao.module.iot.controller.admin.device.vo.data.IotDevicePropertyRespVO; |
| 12 | import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDeviceDO; | 11 | import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDeviceDO; |
| @@ -79,10 +78,8 @@ public class IotDevicePropertyController { | @@ -79,10 +78,8 @@ public class IotDevicePropertyController { | ||
| 79 | } | 78 | } |
| 80 | // 构建对象 | 79 | // 构建对象 |
| 81 | IotDevicePropertyDO property = entry.getValue(); | 80 | IotDevicePropertyDO property = entry.getValue(); |
| 82 | - return BeanUtils.toBean(thingModel, IotDevicePropertyRespVO.class) | ||
| 83 | - .setDataType(thingModel.getProperty().getDataType()) | ||
| 84 | - .setValue(property.getValue()) | ||
| 85 | - .setUpdateTime(LocalDateTimeUtil.toEpochMilli(property.getUpdateTime())); | 81 | + return new IotDevicePropertyRespVO().setProperty(thingModel.getProperty()) |
| 82 | + .setValue(property.getValue()).setUpdateTime(LocalDateTimeUtil.toEpochMilli(property.getUpdateTime())); | ||
| 86 | })); | 83 | })); |
| 87 | } | 84 | } |
| 88 | 85 |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/vo/data/IotDevicePropertyRespVO.java
| 1 | package cn.iocoder.yudao.module.iot.controller.admin.device.vo.data; | 1 | package cn.iocoder.yudao.module.iot.controller.admin.device.vo.data; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.yudao.module.iot.controller.admin.thingmodel.model.ThingModelProperty; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.Data; | 5 | import lombok.Data; |
| 5 | 6 | ||
| @@ -7,8 +8,8 @@ import lombok.Data; | @@ -7,8 +8,8 @@ import lombok.Data; | ||
| 7 | @Data | 8 | @Data |
| 8 | public class IotDevicePropertyRespVO { | 9 | public class IotDevicePropertyRespVO { |
| 9 | 10 | ||
| 10 | - @Schema(description = "属性标识符", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 11 | - private String identifier; | 11 | + @Schema(description = "属性定义", requiredMode = Schema.RequiredMode.REQUIRED) |
| 12 | + private ThingModelProperty property; | ||
| 12 | 13 | ||
| 13 | @Schema(description = "最新值", requiredMode = Schema.RequiredMode.REQUIRED) | 14 | @Schema(description = "最新值", requiredMode = Schema.RequiredMode.REQUIRED) |
| 14 | private Object value; | 15 | private Object value; |
| @@ -16,12 +17,4 @@ public class IotDevicePropertyRespVO { | @@ -16,12 +17,4 @@ public class IotDevicePropertyRespVO { | ||
| 16 | @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) | 17 | @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 17 | private Long updateTime; // 由于从 TDengine 查询出来的是 Long 类型,所以这里也使用 Long 类型 | 18 | private Long updateTime; // 由于从 TDengine 查询出来的是 Long 类型,所以这里也使用 Long 类型 |
| 18 | 19 | ||
| 19 | - // ========== 基于 ThingModel 查询 ========== | ||
| 20 | - | ||
| 21 | - @Schema(description = "属性名称", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 22 | - private String name; | ||
| 23 | - | ||
| 24 | - @Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 25 | - private String dataType; | ||
| 26 | - | ||
| 27 | } | 20 | } |
| 28 | \ No newline at end of file | 21 | \ No newline at end of file |