|
@@ -11,27 +11,23 @@
|
|
@file: AliPayObject.py
|
|
@file: AliPayObject.py
|
|
@Contact: pzb3076@163.com
|
|
@Contact: pzb3076@163.com
|
|
"""
|
|
"""
|
|
-import threading
|
|
|
|
import time
|
|
import time
|
|
import traceback
|
|
import traceback
|
|
|
|
|
|
import requests
|
|
import requests
|
|
-from django.db.models import Count
|
|
|
|
-
|
|
|
|
-from Object.RedisObject import RedisObject
|
|
|
|
import simplejson as json
|
|
import simplejson as json
|
|
|
|
+from django.db import transaction
|
|
from django.utils.decorators import method_decorator
|
|
from django.utils.decorators import method_decorator
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
from django.views.generic.base import View
|
|
from django.views.generic.base import View
|
|
|
|
|
|
-from Model.models import UidSetModel, Device_User, Device_Info, UidPushModel, Equipment_Info, UID_Preview, UID_Bucket, \
|
|
|
|
- VodHlsModel, Order_Model, OssCrdModel, UidUserModel, UidChannelSetModel, User_Brand, ExperienceContextModel, \
|
|
|
|
- StsCrdModel, Unused_Uid_Meal, UIDMainUser, LogModel, CountryModel
|
|
|
|
|
|
+from Model.models import UidSetModel, Device_Info, UidPushModel, Equipment_Info, UID_Preview, UID_Bucket, \
|
|
|
|
+ VodHlsModel, Order_Model, OssCrdModel, UidUserModel, UidChannelSetModel, ExperienceContextModel, \
|
|
|
|
+ StsCrdModel, Unused_Uid_Meal, LogModel, CountryModel
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.TokenObject import TokenObject
|
|
from Object.TokenObject import TokenObject
|
|
from Service.CommonService import CommonService
|
|
from Service.CommonService import CommonService
|
|
from Service.ModelService import ModelService
|
|
from Service.ModelService import ModelService
|
|
-from django.db import transaction
|
|
|
|
from Service.VodHlsService import SplitVodHlsObject
|
|
from Service.VodHlsService import SplitVodHlsObject
|
|
|
|
|
|
'''
|
|
'''
|
|
@@ -107,7 +103,7 @@ class UidSetView(View):
|
|
uid_set_qs = UidSetModel.objects.filter(uid__in=uid_list).values('uid', 'detect_status', 'detect_interval',
|
|
uid_set_qs = UidSetModel.objects.filter(uid__in=uid_list).values('uid', 'detect_status', 'detect_interval',
|
|
'version', 'ucode', 'p2p_region', 'tz',
|
|
'version', 'ucode', 'p2p_region', 'tz',
|
|
'video_code', 'channel', 'cloud_vod')
|
|
'video_code', 'channel', 'cloud_vod')
|
|
-
|
|
|
|
|
|
+
|
|
if uid_set_qs.exists():
|
|
if uid_set_qs.exists():
|
|
return response.json(0, list(uid_set_qs))
|
|
return response.json(0, list(uid_set_qs))
|
|
else:
|
|
else:
|
|
@@ -139,7 +135,7 @@ class UidSetView(View):
|
|
del_uid = UidSetModel.objects.filter(uid__in=uid)
|
|
del_uid = UidSetModel.objects.filter(uid__in=uid)
|
|
if del_uid.exists():
|
|
if del_uid.exists():
|
|
del_uid.delete()
|
|
del_uid.delete()
|
|
- print ('删除UidSetModel')
|
|
|
|
|
|
+ print('删除UidSetModel')
|
|
else:
|
|
else:
|
|
val = 1
|
|
val = 1
|
|
print('UidSetModel表没有数据')
|
|
print('UidSetModel表没有数据')
|
|
@@ -149,7 +145,7 @@ class UidSetView(View):
|
|
del_uid.delete()
|
|
del_uid.delete()
|
|
# print('删除Equipment_Info')
|
|
# print('删除Equipment_Info')
|
|
else:
|
|
else:
|
|
- val = val+1
|
|
|
|
|
|
+ val = val + 1
|
|
print('Equipment_Info表没有数据')
|
|
print('Equipment_Info表没有数据')
|
|
if 'UID_Preview' in id_list:
|
|
if 'UID_Preview' in id_list:
|
|
del_uid = UID_Preview.objects.filter(uid__in=uid)
|
|
del_uid = UID_Preview.objects.filter(uid__in=uid)
|
|
@@ -468,7 +464,7 @@ class UidSetView(View):
|
|
|
|
|
|
uid_channel_set_qs = UidChannelSetModel.objects.filter(uid__uid=uid, channel=channel)
|
|
uid_channel_set_qs = UidChannelSetModel.objects.filter(uid__uid=uid, channel=channel)
|
|
if algorithm_type: # 算法类型
|
|
if algorithm_type: # 算法类型
|
|
- uid_channel_set_qs.filter(algorithm_type=algorithm_type)
|
|
|
|
|
|
+ uid_channel_set_qs.filter(algorithm_type=int(algorithm_type))
|
|
if not uid_channel_set_qs.exists():
|
|
if not uid_channel_set_qs.exists():
|
|
uidObject = UidSetModel.objects.filter(uid=uid)
|
|
uidObject = UidSetModel.objects.filter(uid=uid)
|
|
ucs['channel'] = channel
|
|
ucs['channel'] = channel
|
|
@@ -581,4 +577,4 @@ class UidSetView(View):
|
|
# di_qs = Device_Info.objects.values('area', 'Type').annotate(c=Count('UID', distinct=True)).order_by()
|
|
# di_qs = Device_Info.objects.values('area', 'Type').annotate(c=Count('UID', distinct=True)).order_by()
|
|
# for di in di_qs:
|
|
# for di in di_qs:
|
|
# print(di)
|
|
# print(di)
|
|
- # return response.json(0)
|
|
|
|
|
|
+ # return response.json(0)
|