Ver código fonte

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

guanhailong 2 anos atrás
pai
commit
ee8ac27e71

+ 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))