Commit 79def66e0a0d48df95a327382d0bfd7ed27cae80

Authored by xp.Huang
2 parents 02b54f3d 0d273e38

Merge branch '2024-1-8' into 'master_dev'

feat:物模型TSL增加FunctionType枚举

See merge request yunteng/thingskit!311
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;
  6 +import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum;
5 7
6 8 @Data
7 9 public class BaseModelDTO {
... ... @@ -10,4 +12,7 @@ public class BaseModelDTO {
10 12
11 13 @ApiModelProperty(value = "标识符")
12 14 private String identifier;
  15 +
  16 + @ApiModelProperty(value = "功能类型")
  17 + private FunctionTypeEnum functionType;
13 18 }
... ...
... ... @@ -272,6 +272,7 @@ public class ThingsModelServiceImpl
272 272 AttributeModelDTO attributeModelDTO = new AttributeModelDTO();
273 273 BeanUtils.copyProperties(thingsModelDTO, attributeModelDTO);
274 274 attributeModelDTO.setSpecs(functionJson);
  275 + attributeModelDTO.setFunctionType(FunctionTypeEnum.properties);
275 276 serviceList.add(attributeModelDTO);
276 277 break;
277 278 case services:
... ... @@ -279,12 +280,14 @@ public class ThingsModelServiceImpl
279 280 BeanUtils.copyProperties(thingsModelDTO, serviceDTO);
280 281 serviceDTO.setInputData(functionJson.get(inputData));
281 282 serviceDTO.setOutputData(functionJson.get(outputData));
  283 + serviceDTO.setFunctionType(FunctionTypeEnum.services);
282 284 serviceList.add(serviceDTO);
283 285 break;
284 286 case events:
285 287 EventModelDTO eventDTO = new EventModelDTO();
286 288 BeanUtils.copyProperties(thingsModelDTO, eventDTO);
287 289 eventDTO.setOutputData(functionJson.get(outputData));
  290 + eventDTO.setFunctionType(FunctionTypeEnum.events);
288 291 serviceList.add(eventDTO);
289 292 break;
290 293 default:
... ...