TRX 1 жил өмнө
parent
commit
16f85f20f9

+ 1 - 1
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/controller/iot/openAPI/IotThingOpenAPIController.java

@@ -31,7 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/" + OpenApiMark.iotOpenAPI + "/manager/v1/thing")
 @RestController
 @Validated
-@Tag(name = "物模型-物模型管理")
+@Tag(name = "openAPI-物模型-物模型管理")
 public class IotThingOpenAPIController {
 
     @Autowired

+ 4 - 0
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/iot/IotServiceImpl.java

@@ -378,6 +378,10 @@ public class IotServiceImpl extends SuperService {
         Assert.hasText(param.getName(), "name不能为空");
         Assert.hasText(param.getIdentifier(), "identifier不能为空");
         Assert.hasText(param.getIotTopic(), "iotTopic不能为空");
+
+        if (StringUtils.isNotEmpty(param.getIotThingId())) {
+            param.setIotDataType(IotDataType.Device);
+        }
         IotDataType iotDataType = param.getIotDataType();
         if (iotDataType == null) {
             return ResultContent.buildFail("iotDataType 不能为空");