|
@@ -58,8 +58,10 @@ class DetectControllerView(View):
|
|
|
tko = TokenObject(token)
|
|
|
if tko.code == 0:
|
|
|
userID = tko.userID
|
|
|
+ # 修改推送设置
|
|
|
if operation == 'changeStatus':
|
|
|
return self.do_change_status(userID, request_dict, response)
|
|
|
+ # 查询推送信息
|
|
|
if operation == 'queryInfo':
|
|
|
return self.do_query(request_dict, response, userID)
|
|
|
else:
|
|
@@ -99,13 +101,14 @@ class DetectControllerView(View):
|
|
|
uid = request_dict.get('uid', None)
|
|
|
token_val = request_dict.get('token_val', None)
|
|
|
appBundleId = request_dict.get('appBundleId', None)
|
|
|
+ app_type = request_dict.get('app_type', None)
|
|
|
push_type = request_dict.get('push_type', None)
|
|
|
status = request_dict.get('status', None)
|
|
|
print('status')
|
|
|
print(status)
|
|
|
if status == '0':
|
|
|
uid_app_qs = UID_App.objects.filter(appBundleId=appBundleId, userID_id=userID, token_val=token_val,
|
|
|
- uid=uid)
|
|
|
+ uid=uid,app_type=app_type)
|
|
|
if uid_app_qs.exists():
|
|
|
uid_app_qs.update(status=0)
|
|
|
return response.json(0)
|
|
@@ -115,10 +118,11 @@ class DetectControllerView(View):
|
|
|
# return response.json(10)
|
|
|
|
|
|
dvqs = Device_Info.objects.filter(userID_id=userID, UID=uid)
|
|
|
- aiqs = App_Info.objects.filter(appBundleId=appBundleId).values('app_type')
|
|
|
- print(dvqs)
|
|
|
- print(aiqs)
|
|
|
- if dvqs.exists() and aiqs.exists():
|
|
|
+ # aiqs = App_Info.objects.filter(appBundleId=appBundleId).values('app_type')
|
|
|
+ # print(dvqs)
|
|
|
+ # print(aiqs)
|
|
|
+ # if dvqs.exists() and aiqs.exists():
|
|
|
+ if dvqs.exists():
|
|
|
now_time = int(time.time())
|
|
|
try:
|
|
|
uid_app_qs = UID_App.objects.filter(appBundleId=appBundleId, userID_id=userID, token_val=token_val,
|
|
@@ -131,7 +135,7 @@ class DetectControllerView(View):
|
|
|
uid=uid,
|
|
|
userID_id=userID,
|
|
|
appBundleId=appBundleId,
|
|
|
- app_type=aiqs[0]['app_type'],
|
|
|
+ app_type=app_type,
|
|
|
push_type=push_type,
|
|
|
token_val=token_val,
|
|
|
status=1,
|
|
@@ -172,7 +176,7 @@ class NotificationView(View):
|
|
|
event_type = request_dict.get('event_type', None)
|
|
|
is_st = request_dict.get('is_st', None)
|
|
|
if not all([uidToken, channel, n_time]):
|
|
|
- return JsonResponse(status=404)
|
|
|
+ return JsonResponse(status=404,data={})
|
|
|
# return response.json(444)
|
|
|
utko = UidTokenObject(uidToken)
|
|
|
uid = utko.UID
|