|
@@ -32,6 +32,7 @@ from Object.ResponseObject import ResponseObject
|
|
|
from Object.TokenObject import TokenObject
|
|
|
from Object.UidTokenObject import UidTokenObject
|
|
|
from django.http import JsonResponse
|
|
|
+from Object.RedisObject import RedisObject
|
|
|
|
|
|
|
|
|
# http://192.168.136.40:8077/detect/changeStatus?uid=JW3684H8BSHG9TTM111A&token_val=18071adc03536302f34&appBundleId=com.ansjer.zccloud_ab&push_type=2&token=local&status=1&app_type=1
|
|
@@ -101,9 +102,9 @@ class DetectControllerView(View):
|
|
|
channel = p['Channel']
|
|
|
if p['is_st'] == 1:
|
|
|
p['img'] = img_bucket.sign_url('GET', '{uid}/{channel}/{time}.jpeg'.
|
|
|
- format(uid=devUid, channel=p['Channel'], time=eventTime), 300)
|
|
|
+ format(uid=devUid, channel=p['Channel'], time=eventTime), 300)
|
|
|
p['img_list'] = [img_bucket.sign_url('GET', '{uid}/{channel}/{time}.jpeg'.
|
|
|
- format(uid=devUid, channel=channel, time=eventTime), 300)]
|
|
|
+ format(uid=devUid, channel=channel, time=eventTime), 300)]
|
|
|
elif p['is_st'] == 2:
|
|
|
# 列表装载回放时间戳标记
|
|
|
vodqs = VodHlsModel.objects.filter(uid=devUid, channel=channel, time=int(eventTime)) \
|
|
@@ -227,11 +228,19 @@ class NotificationView(View):
|
|
|
values('token_val', 'app_type', 'appBundleId', 'push_type', 'uid', 'userID_id', 'userID__NickName',
|
|
|
'interval')
|
|
|
if uaqs.exists():
|
|
|
+ redisObj = RedisObject(db=6)
|
|
|
|
|
|
auth = oss2.Auth(OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET)
|
|
|
bucket = oss2.Bucket(auth, 'oss-cn-shenzhen.aliyuncs.com', 'apg')
|
|
|
+
|
|
|
for ua in uaqs:
|
|
|
push_type = ua['push_type']
|
|
|
+ pkey = '{uid}_{channel}_ptl'.format(uid=uid, channel=channel)
|
|
|
+ if redisObj.get_data(key=pkey):
|
|
|
+ res_data = {'code': 0, 'msg': 'success,!'}
|
|
|
+ return JsonResponse(status=200, data=res_data)
|
|
|
+ else:
|
|
|
+ redisObj.set_data(key=pkey, val=1, expire=ua['interval'])
|
|
|
# ios apns
|
|
|
if push_type == 0:
|
|
|
self.do_apns(request_dict, ua, response)
|