Browse Source

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

guanhailong 2 years ago
parent
commit
ee8ac27e71
1 changed files with 6 additions and 1 deletions
  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))