ソースを参照

Merge branch 'test' of http://192.168.136.99:3000/servers/ASJServer into ming

zhangdongming 1 年間 前
コミット
550786c70e

+ 2 - 2
Ansjer/cn_config/config_test.py

@@ -37,8 +37,8 @@ DOMAIN_HOST = 'test.zositechc.cn'
 SERVER_DOMAIN = 'http://test.zositechc.cn/'
 SERVER_DOMAIN_SSL = 'https://test.zositechc.cn/'
 NGINX_RTMP_STAT = 'http://test.zositechc.cn/stat/'
-DETECT_PUSH_DOMAIN = 'http://test.push.zositechc.cn/'
-DETECT_PUSH_DOMAINS = 'https://test.push.zositechc.cn/'
+DETECT_PUSH_DOMAIN = 'http://test.push.dvema.com/'
+DETECT_PUSH_DOMAINS = 'https://test.push.dvema.com/'
 DETECT_PUSH_DOMAIN_JIUAN = 'http://jiuan.push.dvema.com/'
 DETECT_PUSH_DOMAINS_JIUAN = 'https://jiuan.push.dvema.com/'
 TUTK_PUSH_DOMAIN = 'http://push.iotcplatform.com/tpns'

+ 3 - 1
Controller/CloudStorage.py

@@ -1826,7 +1826,7 @@ class CloudStorageView(View):
         order_id = CommonService.createOrderID()
         now_time = int(time.time())
         store_qs = Store_Meal.objects.filter(id=rank, lang__lang=lang, is_show=0).values("day", "bucket_id",
-                                                                                         "expire",
+                                                                                         "expire", "is_ai",
                                                                                          'lang__content', 'price',
                                                                                          'currency', 'commodity_type',
                                                                                          'icloud_store_meal_id')
@@ -1842,6 +1842,8 @@ class CloudStorageView(View):
         is_ai = 1 if uid_set_qs[0]['is_ai'] != 2 else 0
         if is_ai != 1:
             is_ai = self.check_ucode_exists(uid_set_qs[0]['ucode'])
+        if cdk:
+            is_ai = store_qs[0]['is_ai']
 
         order_type = 1 if is_ai and CONFIG_INFO != CONFIG_CN else 0
         use_flag = True

+ 45 - 4
Controller/EquipmentManagerV3.py

@@ -76,6 +76,10 @@ class EquipmentManagerV3(View):
             return self.do_get_device_features(request_dict, response)
         elif operation == 'deviceRouse':
             return self.device_rouse(request_dict, response)
+        elif operation == 'saveButtonUser':
+            return self.save_button_user(request_dict, response)
+        elif operation == 'getButtonUser':
+            return self.get_button_user(request_dict, response)
         else:
             return response.json(414)
 
@@ -302,8 +306,10 @@ class EquipmentManagerV3(View):
                         UidChannelSetModel.objects.bulk_create(UidChannelSet_bulk)
 
                 userDevice = Device_Info(id=id, userID_id=userID, UID=UID, NickName=NickName, View_Account=View_Account,
-                                         View_Password=View_Password, Type=Type, ChannelIndex=ChannelIndex, version=version,
-                                         vodPrimaryUserID=vodPrimaryUserID, vodPrimaryMaster=vodPrimaryMaster)
+                                         View_Password=View_Password, Type=Type, ChannelIndex=ChannelIndex,
+                                         version=version,
+                                         vodPrimaryUserID=vodPrimaryUserID, vodPrimaryMaster=vodPrimaryMaster,
+                                         audioVideoButton=1)
                 userDevice.save()
                 # 添加到家庭房间
                 if family_id:
@@ -332,8 +338,9 @@ class EquipmentManagerV3(View):
                         if uid_channel_set_qs.exists():
                             # 多通道设备名为 UidChannelSetModel 的 channel_name
                             for uid_channel_set in uid_channel_set_qs:
-                                data_list.append({'userID': userID, 'UID': UID, 'uid_nick': uid_channel_set['channel_name'],
-                                                  'channel': uid_channel_set['channel'], 'password': encrypt_pass})
+                                data_list.append(
+                                    {'userID': userID, 'UID': UID, 'uid_nick': uid_channel_set['channel_name'],
+                                     'channel': uid_channel_set['channel'], 'password': encrypt_pass})
                     else:
                         data_list = [{'userID': userID, 'UID': UID, 'uid_nick': NickName, 'password': encrypt_pass}]
 
@@ -1161,3 +1168,37 @@ class EquipmentManagerV3(View):
         except Exception as e:
             LOGGER.info('EquipmentManagerV3.async_del_message,{},error_line:{}, error_msg:{}'
                         .format(uid, e.__traceback__.tb_lineno, repr(e)))
+
+    @staticmethod
+    def save_button_user(request_dict, response):
+        """
+        设置推送按钮用户
+        """
+        uid = request_dict.get('uid', None)
+        button_user1 = request_dict.get('buttonUser1', None)
+        button_user2 = request_dict.get('buttonUser2', None)
+        if not uid:
+            return response.json(444)
+        try:
+            Device_Info.objects.filter(UID=uid).update(audioVideoButton=0)
+            if button_user1:
+                Device_Info.objects.filter(UID=uid, userID=button_user1).update(audioVideoButton=1)
+            if button_user2:
+                Device_Info.objects.filter(UID=uid, userID=button_user2).update(audioVideoButton=2)
+            return response.json(0)
+        except Exception as e:
+            return response.json(500, repr(e))
+
+    @staticmethod
+    def get_button_user(request_dict, response):
+        """
+        获取推送按钮用户
+        """
+        uid = request_dict.get('uid', None)
+        if not uid:
+            return response.json(444)
+        try:
+            device_qs = Device_Info.objects.filter(UID=uid).values('userID', 'audioVideoButton')
+            return response.json(0, list(device_qs))
+        except Exception as e:
+            return response.json(500, repr(e))

+ 1 - 0
Model/models.py

@@ -266,6 +266,7 @@ class Device_Info(models.Model):
     isExist = models.SmallIntegerField(blank=True, default=1, verbose_name='是否被删除')  # 是否被删除了(需主用户交互) 1存在,0不存在,2设备被重置
     isCameraOpenCloud = models.SmallIntegerField(blank=True, default=1, verbose_name='是否开启云存')  # 0:不开启  1:开启
     serial_number = models.CharField(blank=True, max_length=9, default='', verbose_name='关联序列号')
+    audioVideoButton = models.SmallIntegerField(default=0, verbose_name='音视频通话按钮')
     ###
     REQUIRED_FIELDS = []