1
|
1
|
package org.thingsboard.server.common.data.yunteng.dto;
|
2
|
2
|
|
|
3
|
+import com.fasterxml.jackson.databind.JsonNode;
|
3
|
4
|
import io.swagger.annotations.ApiModelProperty;
|
4
|
5
|
import lombok.Data;
|
5
|
6
|
import lombok.EqualsAndHashCode;
|
|
7
|
+import org.thingsboard.common.util.JacksonUtil;
|
|
8
|
+import org.thingsboard.server.common.data.DeviceProfileType;
|
6
|
9
|
import org.thingsboard.server.common.data.DeviceTransportType;
|
7
|
10
|
import org.thingsboard.server.common.data.device.profile.DeviceProfileData;
|
8
|
11
|
import org.thingsboard.server.common.data.yunteng.common.AddGroup;
|
...
|
...
|
@@ -50,26 +53,39 @@ public class DeviceProfileDTO extends TenantDTO { |
50
|
53
|
/**默认消息队列*/
|
51
|
54
|
private String defaultQueueName;
|
52
|
55
|
|
|
56
|
+ /**设备配置图片*/
|
|
57
|
+ private String image;
|
|
58
|
+ /**是否默认设备配置*/
|
|
59
|
+ private boolean isDefault;
|
|
60
|
+ private String type;
|
|
61
|
+
|
53
|
62
|
public DeviceProfileDTO() {
|
54
|
63
|
}
|
55
|
64
|
|
56
|
|
- public DeviceProfileDTO(UUID id, String name, Long time, String description, DeviceTransportType transportType, UUID defaultRuleChainId) {
|
|
65
|
+ public DeviceProfileDTO(UUID id, String name, Long time, String description, DeviceTransportType transportType, UUID defaultRuleChainId,boolean isDefault,String image,DeviceProfileType type,Object profileData) {
|
57
|
66
|
setId(id.toString());
|
58
|
67
|
setCreateTime(LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneOffset.UTC));
|
59
|
68
|
this.name = name;
|
|
69
|
+ this.isDefault = isDefault;
|
|
70
|
+ this.image = image;
|
60
|
71
|
this.description = description;
|
|
72
|
+ this.type = type.name();
|
61
|
73
|
this.transportType = transportType.name();
|
62
|
74
|
this.defaultRuleChainId = Optional.ofNullable(defaultRuleChainId).map(chainId -> chainId.toString()).orElse(null);
|
|
75
|
+ this.profileData = JacksonUtil.convertValue(profileData, DeviceProfileData.class);
|
|
76
|
+
|
63
|
77
|
}
|
64
|
78
|
|
65
|
|
- public DeviceProfileDTO(UUID id, String name, Long time, String description, String convertJs, DeviceTransportType transportType, DeviceProfileData profileData, String defaultRuleChainId) {
|
|
79
|
+ public DeviceProfileDTO(UUID id, String name, Long time, String description, DeviceTransportType transportType, String defaultRuleChainId,boolean isDefault,String image,DeviceProfileType type, String convertJs) {
|
66
|
80
|
setId(id.toString());
|
67
|
81
|
setCreateTime(LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneOffset.UTC));
|
68
|
82
|
this.name = name;
|
|
83
|
+ this.isDefault = isDefault;
|
|
84
|
+ this.image = image;
|
69
|
85
|
this.description = description;
|
|
86
|
+ this.type = type.name();
|
70
|
87
|
this.convertJs = convertJs;
|
71
|
88
|
this.transportType = transportType.name();
|
72
|
89
|
this.defaultRuleChainId = defaultRuleChainId.toString();
|
73
|
|
- this.profileData = profileData;
|
74
|
90
|
}
|
75
|
91
|
} |
...
|
...
|
|