def get_microsegment_changers_with_attributes_callback(request):
params = parse_qs(urlparse(request.url).query)
if params['StartDate'][0] == '2016-01-01' and params['EndDate'][0] == '2016-01-31'\
and params['CustomerAttributes'][0] == 'Alias;Country'\
and params['CustomerAttributesDelimiter'][0] == ',':
resp_body = [
{'CustomerID': '231342', 'InitialMicrosegmentID': 4, 'FinalMicrosegmentID': 12,
'CustomerAttributes': 'BuddyZZ,UK'},
{'CustomerID': '231342', 'InitialMicrosegmentID': 3, 'FinalMicrosegmentID': 67,
'CustomerAttributes': 'Player99,US'}
]
return 200, HEADERS['json'], json.dumps(resp_body)
else:
return 404, HEADERS['text'], 'Not Found'
评论列表
文章目录