def get_customer_one_time_actions_by_date_callback(request):
params = parse_qs(urlparse(request.url).query)
if params['Date'][0] == '2015-06-24':
if 'CustomerAttributes' in params and 'CustomerAttributesDelimiter' in params:
if params['CustomerAttributes'][0] == 'Alias;Country' and params['CustomerAttributesDelimiter'][0] == ',':
resp_body = [
{'CustomerID': '8D871', 'ActionID': 19, 'ChannelID': 3, 'CustomerAttribute': 'Yo999,UA'},
{'CustomerID': '8U76T', 'ActionID': 19, 'ChannelID': 3, 'CustomerAttribute': 'Neto2,TR'}
]
else:
return 404, HEADERS['text'], 'Not Found'
else:
resp_body = [
{'CustomerID': '8D871', 'ActionID': 19, 'ChannelID': 3},
{'CustomerID': '8U76T', 'ActionID': 19, 'ChannelID': 3}
]
return 200, HEADERS['json'], json.dumps(resp_body)
else:
return 404, HEADERS['text'], 'Not Found'
评论列表
文章目录