def get_customer_actions_by_target_group_callback(request):
params = parse_qs(urlparse(request.url).query)
if params['TargetGroupID'][0] == '2' and params['Date'][0] == '2015-12-24':
if 'CustomerAttributes' in params and 'CustomerAttributesDelimiter' in params:
if params['CustomerAttributes'][0] == 'Alias;Country' and params['CustomerAttributesDelimiter'][0] == ',':
resp_body = [
{'CustomerID': 'A1342', 'ActionID': 49, 'ChannelID': 6, 'CustomerAttribute': 'BuddyZZ,UK'},
{'CustomerID': 'G4650', 'ActionID': 49, 'ChannelID': 6, 'CustomerAttribute': 'Mighty6,ES'}
]
else:
return 404, HEADERS['text'], 'Not Found'
else:
resp_body = [
{'CustomerID': 'A1342', 'ActionID': 49, 'ChannelID': 6},
{'CustomerID': 'G4650', 'ActionID': 49, 'ChannelID': 6}
]
return 200, HEADERS['json'], json.dumps(resp_body)
else:
return 404, HEADERS['text'], 'Not Found'
评论列表
文章目录