Răsfoiți Sursa

云存位置和APP类型

locky 2 săptămâni în urmă
părinte
comite
0dda5d0e0f
1 a modificat fișierele cu 12 adăugiri și 3 ștergeri
  1. 12 3
      AdminController/ServeManagementController.py

+ 12 - 3
AdminController/ServeManagementController.py

@@ -239,6 +239,7 @@ class serveManagement(View):
                     'is_free': vod_bucket.is_free,
                     'storeDay': vod_bucket.storeDay,
                     'region_id': vod_bucket.region_id,
+                    'vod_location': vod_bucket.vod_location,
                     'addTime': time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(vod_bucket.addTime)),
                     'updTime': time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(vod_bucket.updTime)),
                 })
@@ -262,6 +263,7 @@ class serveManagement(View):
         is_free = int(request_dict.get('is_free', 0))
         storeDay = int(request_dict.get('storeDay', 0))
         region_id = int(request_dict.get('region_id', 1))
+        vod_location = int(request_dict.get('vod_location', 0))
         isEdit = request_dict.get('isEdit', None)
 
         if not all([bucket, content, area, region, endpoint]):
@@ -279,6 +281,7 @@ class serveManagement(View):
                 'is_free': is_free,
                 'storeDay': storeDay,
                 'region_id': region_id,
+                'vod_location': vod_location
             }
             if isEdit:
                 if not bucketID:
@@ -385,7 +388,9 @@ class serveManagement(View):
                 'pixel_level',
                 'add_time',
                 'update_time',
-                'is_4g')
+                'is_4g',
+                'app_type',
+            )
             store_meal_list = []
             for store_meal in store_meal_val:
                 store_meal_id = store_meal['id']
@@ -430,6 +435,7 @@ class serveManagement(View):
                     'subscription_group_id': subscription_group_id,
                     'package_type': package_type,
                     'is_4g':store_meal['is_4g'],
+                    'app_type': store_meal['app_type'],
                     'addTime': store_meal['add_time'].strftime("%Y-%m-%d %H:%M:%S"),
                     'updTime': store_meal['update_time'].strftime("%Y-%m-%d %H:%M:%S"),
                 })
@@ -467,6 +473,7 @@ class serveManagement(View):
         package_type = int(request_dict.get('package_type', 0))
         isEdit = request_dict.get('isEdit', None)
         is_4g = int(request_dict.get('is_4g', 0))
+        app_type = request_dict.get('app_type', None)
 
         if not all([bucket, pay_type, price, currency, symbol]):
             return response.json(444)
@@ -490,7 +497,8 @@ class serveManagement(View):
                 'is_show': is_show,
                 'is_ai': is_ai,
                 'pixel_level': pixel_level,
-                'is_4g': is_4g
+                'is_4g': is_4g,
+                'app_type': app_type,
             }
             if isEdit:
                 if not storeMealID:
@@ -1995,7 +2003,7 @@ class serveManagement(View):
             ).values('time', 'upload_duration', 'upload_frequency')
 
             # 查询用户请求数据
-            sts_crd_qs = StsCrdModel.objects.filter(uid=uid).values('addTime', 'channel')
+            sts_crd_qs = StsCrdModel.objects.filter(uid=uid).values('addTime', 'channel', 'bucket__vod_location')
 
             # 初始化响应数据
             res_data = {
@@ -2015,6 +2023,7 @@ class serveManagement(View):
                 sts_crd = sts_crd_qs[0]
                 res_data['last_request_time'] = sts_crd['addTime']
                 res_data['channel'] = sts_crd['channel']
+                res_data['bucket_vod_location'] = sts_crd['bucket__vod_location']
 
             # 填充云存储数据
             if vod_hls_summary_qs.exists():