Commit 79def66e0a0d48df95a327382d0bfd7ed27cae80
Merge branch '2024-1-8' into 'master_dev'
feat:物模型TSL增加FunctionType枚举 See merge request yunteng/thingskit!311
Showing
2 changed files
with
8 additions
and
0 deletions
1 | package org.thingsboard.server.common.data.yunteng.dto; | 1 | package org.thingsboard.server.common.data.yunteng.dto; |
2 | 2 | ||
3 | +import com.fasterxml.jackson.databind.JsonNode; | ||
3 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
4 | import lombok.Data; | 5 | import lombok.Data; |
6 | +import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum; | ||
5 | 7 | ||
6 | @Data | 8 | @Data |
7 | public class BaseModelDTO { | 9 | public class BaseModelDTO { |
@@ -10,4 +12,7 @@ public class BaseModelDTO { | @@ -10,4 +12,7 @@ public class BaseModelDTO { | ||
10 | 12 | ||
11 | @ApiModelProperty(value = "标识符") | 13 | @ApiModelProperty(value = "标识符") |
12 | private String identifier; | 14 | private String identifier; |
15 | + | ||
16 | + @ApiModelProperty(value = "功能类型") | ||
17 | + private FunctionTypeEnum functionType; | ||
13 | } | 18 | } |
@@ -272,6 +272,7 @@ public class ThingsModelServiceImpl | @@ -272,6 +272,7 @@ public class ThingsModelServiceImpl | ||
272 | AttributeModelDTO attributeModelDTO = new AttributeModelDTO(); | 272 | AttributeModelDTO attributeModelDTO = new AttributeModelDTO(); |
273 | BeanUtils.copyProperties(thingsModelDTO, attributeModelDTO); | 273 | BeanUtils.copyProperties(thingsModelDTO, attributeModelDTO); |
274 | attributeModelDTO.setSpecs(functionJson); | 274 | attributeModelDTO.setSpecs(functionJson); |
275 | + attributeModelDTO.setFunctionType(FunctionTypeEnum.properties); | ||
275 | serviceList.add(attributeModelDTO); | 276 | serviceList.add(attributeModelDTO); |
276 | break; | 277 | break; |
277 | case services: | 278 | case services: |
@@ -279,12 +280,14 @@ public class ThingsModelServiceImpl | @@ -279,12 +280,14 @@ public class ThingsModelServiceImpl | ||
279 | BeanUtils.copyProperties(thingsModelDTO, serviceDTO); | 280 | BeanUtils.copyProperties(thingsModelDTO, serviceDTO); |
280 | serviceDTO.setInputData(functionJson.get(inputData)); | 281 | serviceDTO.setInputData(functionJson.get(inputData)); |
281 | serviceDTO.setOutputData(functionJson.get(outputData)); | 282 | serviceDTO.setOutputData(functionJson.get(outputData)); |
283 | + serviceDTO.setFunctionType(FunctionTypeEnum.services); | ||
282 | serviceList.add(serviceDTO); | 284 | serviceList.add(serviceDTO); |
283 | break; | 285 | break; |
284 | case events: | 286 | case events: |
285 | EventModelDTO eventDTO = new EventModelDTO(); | 287 | EventModelDTO eventDTO = new EventModelDTO(); |
286 | BeanUtils.copyProperties(thingsModelDTO, eventDTO); | 288 | BeanUtils.copyProperties(thingsModelDTO, eventDTO); |
287 | eventDTO.setOutputData(functionJson.get(outputData)); | 289 | eventDTO.setOutputData(functionJson.get(outputData)); |
290 | + eventDTO.setFunctionType(FunctionTypeEnum.events); | ||
288 | serviceList.add(eventDTO); | 291 | serviceList.add(eventDTO); |
289 | break; | 292 | break; |
290 | default: | 293 | default: |