|
|
@@ -2,6 +2,7 @@ package com.zhongshu.iot.server.core.service.device;
|
|
|
|
|
|
import com.github.microservice.busInfoModel.device.DeviceInfoModel;
|
|
|
import com.github.microservice.busInfoModel.device.DeviceInfoMoreModel;
|
|
|
+import com.github.microservice.busInfoModel.device.DeviceInfoSimpleModel;
|
|
|
import com.github.microservice.busInfoModel.device.IotTemplateSimpleModel;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.net.ResultMessage;
|
|
|
@@ -468,6 +469,11 @@ public class DeviceInfoService {
|
|
|
return toModel(deviceInfo);
|
|
|
}
|
|
|
|
|
|
+ public DeviceInfoSimpleModel toSimpleModel(String deviceId) {
|
|
|
+ DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceId(deviceId);
|
|
|
+ return toSimpleModel(deviceInfo);
|
|
|
+ }
|
|
|
+
|
|
|
public DeviceInfoModel toModel(DeviceInfo deviceInfo) {
|
|
|
DeviceInfoModel deviceInfoModel = new DeviceInfoModel();
|
|
|
if (ObjectUtils.isNotEmpty(deviceInfo)) {
|
|
|
@@ -482,6 +488,14 @@ public class DeviceInfoService {
|
|
|
return deviceInfoModel;
|
|
|
}
|
|
|
|
|
|
+ public DeviceInfoSimpleModel toSimpleModel(DeviceInfo deviceInfo) {
|
|
|
+ DeviceInfoSimpleModel deviceInfoModel = new DeviceInfoSimpleModel();
|
|
|
+ if (ObjectUtils.isNotEmpty(deviceInfo)) {
|
|
|
+ BeanUtils.copyProperties(deviceInfo, deviceInfoModel);
|
|
|
+ }
|
|
|
+ return deviceInfoModel;
|
|
|
+ }
|
|
|
+
|
|
|
public DeviceInfoMoreModel toMoreModel(DeviceInfo deviceInfo) {
|
|
|
DeviceInfoMoreModel deviceInfoModel = new DeviceInfoMoreModel();
|
|
|
if (ObjectUtils.isNotEmpty(deviceInfo)) {
|