|
|
@ -30,11 +30,14 @@ def get_data_from_redis(redis_key): |
|
|
|
print('handled_data', json.dumps(redis_data['handled_data'])) |
|
|
|
print('handled_data', json.dumps(redis_data['handled_data'])) |
|
|
|
resp_result = resp['res']['status'] |
|
|
|
resp_result = resp['res']['status'] |
|
|
|
if str(resp_result) == '1': |
|
|
|
if str(resp_result) == '1': |
|
|
|
|
|
|
|
print('get_data_from_redis-1') |
|
|
|
resp_data = resp['res']['data'] if isinstance(resp['res']['data'], list) else [resp['res']['data']] |
|
|
|
resp_data = resp['res']['data'] if isinstance(resp['res']['data'], list) else [resp['res']['data']] |
|
|
|
print('get_data_from_redis-resp_data', resp_data) |
|
|
|
print('get_data_from_redis-resp_data', resp_data) |
|
|
|
if str(resp_result) != '1': |
|
|
|
if str(resp_result) != '1': |
|
|
|
|
|
|
|
print('get_data_from_redis-2') |
|
|
|
return False, redis_data['format'], '请检查接口返回值或手动输入参数:', 0 |
|
|
|
return False, redis_data['format'], '请检查接口返回值或手动输入参数:', 0 |
|
|
|
if len(resp_data) == 0: |
|
|
|
if len(resp_data) == 0: |
|
|
|
|
|
|
|
print('get_data_from_redis-3') |
|
|
|
return False, redis_data['format'], '接口返回数据为空,请手动输入参数:', 0 |
|
|
|
return False, redis_data['format'], '接口返回数据为空,请手动输入参数:', 0 |
|
|
|
return True, redis_data['format'], random.choice(resp_data), redis_data['timestamp'] |
|
|
|
return True, redis_data['format'], random.choice(resp_data), redis_data['timestamp'] |
|
|
|
return False, 'json', '请手动输入参数,或先请求接口:', 0 |
|
|
|
return False, 'json', '请手动输入参数,或先请求接口:', 0 |
|
|
|