示例#1
0
文件: ps.py 项目: mjromper/pm-ps
 def POST(request, entity):
     try:
         dic = json.loads(entity)
         itemId = str(dic['itemId'])
         logging.debug('POST (%s) event, data: %s', 'purchase', entity) 
         data = buildJSonEvent(entity, 'purchase', None, None, None)
         res = PSHttpClient.postEvent('purchase', itemId, data)
         logging.debug("purchase = %s,",str(res))
         return str(res)
     except: 
         logging.error("purchase err= %s,", 400)
         doPOSTexception(dic,itemId)   
         raise restlite.Status, '400 Error purchasing event'
示例#2
0
文件: ps.py 项目: mjromper/pm-ps
 def POST(request, entity):
     try:
         dic = json.loads(entity)
         itemId = str(dic['itemId'])
         timeDuration = str(dic['timeDuration'])
         logging.debug('POST (%s) event, data: %s', 'view', entity) 
         data = buildJSonEvent(entity,'view', timeDuration, None, None) 
         res = PSHttpClient.postEvent('view', itemId, data)
         logging.debug("view = %s,",str(res))
         return str(res)
     except: 
         logging.error("view err= %s,", 400)
         doPOSTexception(dic,itemId)           
         raise restlite.Status, '400 Error viewing event'
示例#3
0
文件: ps.py 项目: mjromper/pm-ps
 def POST(request, entity):
     try:
         dic = json.loads(entity)
         logging.debug("Location %,", 400)
         logging.debug('POST (%s) event, data: %s', 'click', entity)
         itemId = str(dic['itemId'])
         recommId = str(dic['recommId'])
         data = buildJSonEvent(entity, 'click', None, recommId,None)
         res = PSHttpClient.postEvent('click', itemId, data)  
         logging.debug("click = %s,",str(res))
         return str(res)
     except: 
         logging.error("click err= %s,", 400)
         doPOSTexception(dic,itemId)   
         raise restlite.Status, '400 Error click event'