فهرست منبع

设备影子表增加检测类型字段

peng 2 سال پیش
والد
کامیت
e7447446d5
2فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 3 0
      Controller/ShadowController.py
  2. 1 0
      Model/models.py

+ 3 - 0
Controller/ShadowController.py

@@ -118,6 +118,7 @@ def update_device_shadow(request):
         mobile_4g = request_dict.get('mobile4G', None)
         is_ptz = request_dict.get('is_ptz', None)
         is_ai = request_dict.get('is_ai', None)
+        ai_type = request_dict.get('AiType', None)
         isSupportFourPoint = request_dict.get('isSupportFourPoint', None)
 
         # 更新
@@ -158,6 +159,8 @@ def update_device_shadow(request):
             qs_dict['is_ai'] = is_ai
         if isSupportFourPoint:
             qs_dict['isSupportFourPoint'] = isSupportFourPoint
+        if ai_type:
+            qs_dict['ai_type'] = ai_type
         ipInfo = CommonService.getIpIpInfo(ip, 'CN')
         country_qs = CountryModel.objects.filter(country_code=ipInfo['country_code']).values('id')
         if country_qs.exists():

+ 1 - 0
Model/models.py

@@ -1166,6 +1166,7 @@ class UidSetModel(models.Model):
     new_detect_interval = models.IntegerField(blank=True, verbose_name='新加-消息提醒间隔', default=60)  # 秒
     tb_country = models.IntegerField(blank=True, default=0, verbose_name='国家')
     device_type = models.SmallIntegerField(default=0, verbose_name='设备类型')
+    ai_type = models.SmallIntegerField(default=0, verbose_name='检测类型')
 
     class Meta:
         db_table = 'uid_set'