diff --git a/iot-dao/iot-data-model/src/main/java/cc/iotkit/model/device/VirtualDevice.java b/iot-dao/iot-data-model/src/main/java/cc/iotkit/model/device/VirtualDevice.java index 13d86885..0dc57f9a 100644 --- a/iot-dao/iot-data-model/src/main/java/cc/iotkit/model/device/VirtualDevice.java +++ b/iot-dao/iot-data-model/src/main/java/cc/iotkit/model/device/VirtualDevice.java @@ -97,11 +97,11 @@ public class VirtualDevice implements Owned { /** * 运行状态 */ - private String state = STATE_STOPPED; + private String state; /** * 创建时间 */ - private Long createAt = System.currentTimeMillis(); + private Long createAt; } diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/VirtualDeviceController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/VirtualDeviceController.java index 91345e8d..2bb9b6df 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/VirtualDeviceController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/VirtualDeviceController.java @@ -15,6 +15,7 @@ import cc.iotkit.common.api.Request; import cc.iotkit.common.enums.ErrCode; import cc.iotkit.common.exception.BizException; import cc.iotkit.common.utils.ReflectUtil; +import cc.iotkit.common.validate.QueryGroup; import cc.iotkit.data.manager.IVirtualDeviceData; import cc.iotkit.manager.dto.bo.ChangeStateBo; import cc.iotkit.manager.dto.bo.device.DeviceLogQueryBo; @@ -56,7 +57,7 @@ public class VirtualDeviceController { @ApiOperation("获取虚拟设备列表") @SaCheckPermission("iot:virtualDevice:query") @PostMapping("/list") - public Paging getDevices(PageRequest pageRequest) { + public Paging getDevices(@Validated(QueryGroup.class)@RequestBody PageRequest pageRequest) { return virtualDeviceData.findAll(pageRequest); }