浏览代码

优化添加网关设备的返回结果

guanhailong 2 年之前
父节点
当前提交
ee8ac27e71
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Controller/SensorGateway/EquipmentFamilyController.py

+ 6 - 1
Controller/SensorGateway/EquipmentFamilyController.py

@@ -216,7 +216,12 @@ class EquipmentFamilyView(View):
                         'tb_country': country
                     }
                     UidSetModel.objects.create(**uid_set_create_dict)
-                return response.json(0)
+                    res = {
+                        'id': device_id,
+                        'nickname': nick_name,
+                        'serialNumber': serial_number
+                    }
+                return response.json(0, res)
         except Exception as e:
             print(e)
             return response.json(177, repr(e))