|
@@ -89,6 +89,7 @@ class DetectControllerViewV2(View):
|
|
|
tz = request_dict.get('tz', '0')
|
|
|
company_secrete = request_dict.get('company_secrete', None)
|
|
|
region = request_dict.get('region', None) # app必须传:2:国内 1:国外
|
|
|
+ electricity_status = request_dict.get('electricity_status', None)
|
|
|
if not region:
|
|
|
return response.json(444, 'region')
|
|
|
region = int(region)
|
|
@@ -172,6 +173,25 @@ class DetectControllerViewV2(View):
|
|
|
|
|
|
uid_set_id = uid_set_qs.id
|
|
|
|
|
|
+ # 初始化UidPushModel推送表
|
|
|
+ if electricity_status:
|
|
|
+ uid_push_create_dict = {
|
|
|
+ 'uid_set_id': uid_set_id,
|
|
|
+ 'userID_id': userID,
|
|
|
+ 'appBundleId': appBundleId,
|
|
|
+ 'app_type': app_type,
|
|
|
+ 'push_type': push_type,
|
|
|
+ 'token_val': token_val,
|
|
|
+ 'm_code': m_code,
|
|
|
+ 'addTime': nowTime,
|
|
|
+ 'updTime': nowTime,
|
|
|
+ 'lang': lang,
|
|
|
+ 'tz': tz
|
|
|
+ }
|
|
|
+ # 绑定设备推送
|
|
|
+ UidPushModel.objects.create(**uid_push_create_dict)
|
|
|
+ return response.json(0)
|
|
|
+
|
|
|
if status == 0:
|
|
|
# 状态为0的时候删除redis缓存数据
|
|
|
self.do_delete_redis(uid)
|