|
@@ -52,7 +52,7 @@ from Model.models import (
|
|
TestSerialRepetition,
|
|
TestSerialRepetition,
|
|
UID_Bucket,
|
|
UID_Bucket,
|
|
UIDCompanySerialModel,
|
|
UIDCompanySerialModel,
|
|
- VodBucketModel, PaypalWebHookEvent, TimeZoneInfo, CountryLanguageModel,
|
|
|
|
|
|
+ VodBucketModel, PaypalWebHookEvent, TimeZoneInfo, CountryLanguageModel, UidSetModel, UidPushModel,
|
|
)
|
|
)
|
|
from Object.AliPayObject import AliPayObject
|
|
from Object.AliPayObject import AliPayObject
|
|
from Object.AWS.AmazonS3Util import AmazonS3Util
|
|
from Object.AWS.AmazonS3Util import AmazonS3Util
|
|
@@ -195,6 +195,8 @@ class testView(View):
|
|
return self.lang_country(request_dict, response)
|
|
return self.lang_country(request_dict, response)
|
|
elif operation == 'getObsSignedUrl':
|
|
elif operation == 'getObsSignedUrl':
|
|
return self.getObsSignedUrl(request_dict, response)
|
|
return self.getObsSignedUrl(request_dict, response)
|
|
|
|
+ elif operation == 'duplicateRemovalUidSet':
|
|
|
|
+ return self.duplicate_removal_uid_set(request_dict, response)
|
|
else:
|
|
else:
|
|
return response.json(414)
|
|
return response.json(414)
|
|
|
|
|
|
@@ -1449,3 +1451,31 @@ class testView(View):
|
|
except Exception as e:
|
|
except Exception as e:
|
|
print(e)
|
|
print(e)
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
+
|
|
|
|
+ @staticmethod
|
|
|
|
+ def duplicate_removal_uid_set(request_dict, response):
|
|
|
|
+ """
|
|
|
|
+ uid_set去重
|
|
|
|
+ @param request_dict: 请求参数
|
|
|
|
+ @param response: 响应对象
|
|
|
|
+ @return: response
|
|
|
|
+ """
|
|
|
|
+ try:
|
|
|
|
+ uid_list = []
|
|
|
|
+ with open('uid.txt', 'r') as file:
|
|
|
|
+ lines = file.readlines()
|
|
|
|
+ for line in lines:
|
|
|
|
+ uid_list.append(line.rstrip())
|
|
|
|
+ print(uid_list)
|
|
|
|
+ for uid in uid_list:
|
|
|
|
+ uid_set_qs = UidSetModel.objects.filter(uid=uid).values('id', 'ai_type')
|
|
|
|
+ for uid_set in uid_set_qs:
|
|
|
|
+ # 删除没关联uid push的数据
|
|
|
|
+ uid_set_id = uid_set['id']
|
|
|
|
+ uid_push_qs = UidPushModel.objects.filter(uid_set_id=uid_set['id'])
|
|
|
|
+ if not uid_push_qs.exists():
|
|
|
|
+ # UidSetModel.objects.filter(id=uid_set_id).delete()
|
|
|
|
+ break
|
|
|
|
+ return response.json(0)
|
|
|
|
+ except Exception as e:
|
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|