|
@@ -461,11 +461,10 @@ class CloudStorageView(View):
|
|
})
|
|
})
|
|
|
|
|
|
device_info_qs = Device_Info.objects.filter(userID_id=user_id, UID=uid, isShare=False).values(
|
|
device_info_qs = Device_Info.objects.filter(userID_id=user_id, UID=uid, isShare=False).values(
|
|
- 'vodPrimaryUserID',
|
|
|
|
- 'vodPrimaryMaster')
|
|
|
|
|
|
+ 'vodPrimaryUserID', 'Type', 'vodPrimaryMaster')
|
|
if not device_info_qs.exists():
|
|
if not device_info_qs.exists():
|
|
return response.json(12)
|
|
return response.json(12)
|
|
-
|
|
|
|
|
|
+ device_type = device_info_qs[0]['Type']
|
|
device_info_qs_time_over = int(time.time())
|
|
device_info_qs_time_over = int(time.time())
|
|
if uid == 'UWE2ZJ52SE4FX75U111A':
|
|
if uid == 'UWE2ZJ52SE4FX75U111A':
|
|
logger.info({
|
|
logger.info({
|
|
@@ -476,8 +475,10 @@ class CloudStorageView(View):
|
|
if device_info_qs[0]['vodPrimaryUserID'] != user_id:
|
|
if device_info_qs[0]['vodPrimaryUserID'] != user_id:
|
|
return response.json(10034)
|
|
return response.json(10034)
|
|
now_time = int(time.time())
|
|
now_time = int(time.time())
|
|
- uid_bucket_qs = UID_Bucket.objects.filter(uid=uid, endTime__gte=now_time, channel=channel).values(
|
|
|
|
- 'bucket_id').order_by('addTime')
|
|
|
|
|
|
+ if device_type == 34: # 枪球设备开通云存不区分通道
|
|
|
|
+ uid_bucket_qs = UID_Bucket.objects.filter(uid=uid, endTime__gte=now_time)
|
|
|
|
+ else:
|
|
|
|
+ uid_bucket_qs = UID_Bucket.objects.filter(uid=uid, endTime__gte=now_time, channel=channel)
|
|
if not uid_bucket_qs.exists():
|
|
if not uid_bucket_qs.exists():
|
|
return response.json(10030)
|
|
return response.json(10030)
|
|
|
|
|
|
@@ -666,18 +667,23 @@ class CloudStorageView(View):
|
|
if not all([uid, status, channel]):
|
|
if not all([uid, status, channel]):
|
|
return response.json(444, 'uid,status,channel')
|
|
return response.json(444, 'uid,status,channel')
|
|
device_info_qs = Device_Info.objects.filter(userID_id=user_id, UID=uid, isShare=False, isExist=1).values(
|
|
device_info_qs = Device_Info.objects.filter(userID_id=user_id, UID=uid, isShare=False, isExist=1).values(
|
|
- 'vodPrimaryUserID')
|
|
|
|
|
|
+ 'vodPrimaryUserID', 'Type')
|
|
if not device_info_qs.exists() or device_info_qs[0]['vodPrimaryUserID'] != user_id:
|
|
if not device_info_qs.exists() or device_info_qs[0]['vodPrimaryUserID'] != user_id:
|
|
return response.json(12)
|
|
return response.json(12)
|
|
- uid_bucket_qs = UID_Bucket.objects.filter(channel=channel, uid=uid)
|
|
|
|
|
|
+ device_type = device_info_qs[0]['Type']
|
|
|
|
+ if device_type == 34: # 枪球设备开通云存不区分通道
|
|
|
|
+ uid_bucket_qs = UID_Bucket.objects.filter(uid=uid)
|
|
|
|
+ else:
|
|
|
|
+ uid_bucket_qs = UID_Bucket.objects.filter(channel=channel, uid=uid)
|
|
if not uid_bucket_qs.exists():
|
|
if not uid_bucket_qs.exists():
|
|
return response.json(10030)
|
|
return response.json(10030)
|
|
now_time = int(time.time())
|
|
now_time = int(time.time())
|
|
if now_time > uid_bucket_qs[0].endTime:
|
|
if now_time > uid_bucket_qs[0].endTime:
|
|
return response.json(10031)
|
|
return response.json(10031)
|
|
- uid_bucket_qs.update(status=status)
|
|
|
|
if status == 0:
|
|
if status == 0:
|
|
|
|
+ uid_bucket_qs.update(status=status)
|
|
return response.json(0)
|
|
return response.json(0)
|
|
|
|
+ uid_bucket_qs.update(status=status, channel=channel)
|
|
uid_obj = UidTokenObject()
|
|
uid_obj = UidTokenObject()
|
|
uid_obj.generate(data={'uid': uid, 'channel': channel})
|
|
uid_obj.generate(data={'uid': uid, 'channel': channel})
|
|
|
|
|