|
@@ -146,8 +146,21 @@ class MyserviceDynamodb(object):
|
|
dynamodb = self.session.resource('dynamodb')
|
|
dynamodb = self.session.resource('dynamodb')
|
|
table = dynamodb.Table(table_name)
|
|
table = dynamodb.Table(table_name)
|
|
with table.batch_writer() as batch:
|
|
with table.batch_writer() as batch:
|
|
|
|
+
|
|
for i in data_list:
|
|
for i in data_list:
|
|
data = json.loads(i.decode('utf-8'))
|
|
data = json.loads(i.decode('utf-8'))
|
|
|
|
+ # print (json.loads(i))
|
|
|
|
+ # data = i
|
|
|
|
+ if data['city'] == '':
|
|
|
|
+ data['city'] = '无'
|
|
|
|
+ if data['area'] == '':
|
|
|
|
+ data['area'] = '无'
|
|
|
|
+ if data['street'] == '':
|
|
|
|
+ data['street'] = '无'
|
|
|
|
+ if data['longitude'] == '':
|
|
|
|
+ data['longitude'] = '无'
|
|
|
|
+ if data['latitude'] == '':
|
|
|
|
+ data['latitude'] = '无'
|
|
batch.put_item(
|
|
batch.put_item(
|
|
Item={
|
|
Item={
|
|
'userID': data['userID'],
|
|
'userID': data['userID'],
|
|
@@ -445,6 +458,7 @@ class UserBrandInfo(View):
|
|
longitude='无'
|
|
longitude='无'
|
|
if latitude is None:
|
|
if latitude is None:
|
|
latitude='无'
|
|
latitude='无'
|
|
|
|
+
|
|
param_area = CommonService.get_param_flag(data=[country,province,city])
|
|
param_area = CommonService.get_param_flag(data=[country,province,city])
|
|
must_fill_in = CommonService.get_param_flag(data=[appId,deviceSupplier,deviceModel,osType,osVersion])
|
|
must_fill_in = CommonService.get_param_flag(data=[appId,deviceSupplier,deviceModel,osType,osVersion])
|
|
if must_fill_in is False:
|
|
if must_fill_in is False:
|
|
@@ -516,7 +530,7 @@ class UserBrandInfo(View):
|
|
redisObj.rpush(name=logKey, val=add_user_brand_all_data)
|
|
redisObj.rpush(name=logKey, val=add_user_brand_all_data)
|
|
print (redisObj.llen(name=logKey))
|
|
print (redisObj.llen(name=logKey))
|
|
# 判断redis列表长度
|
|
# 判断redis列表长度
|
|
- if redisObj.llen(name=logKey) > 10:
|
|
|
|
|
|
+ if redisObj.llen(name=logKey) > 1:
|
|
data_list = redisObj.lrange(logKey, 0, -1)
|
|
data_list = redisObj.lrange(logKey, 0, -1)
|
|
redisObj.del_data(key=logKey)
|
|
redisObj.del_data(key=logKey)
|
|
# 添加user_brand_all表信息
|
|
# 添加user_brand_all表信息
|