当前位置: 首页>>代码示例>>Python>>正文


Python Account.api_submit方法代码示例

本文整理汇总了Python中storyengine.model.account.Account.api_submit方法的典型用法代码示例。如果您正苦于以下问题:Python Account.api_submit方法的具体用法?Python Account.api_submit怎么用?Python Account.api_submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在storyengine.model.account.Account的用法示例。


在下文中一共展示了Account.api_submit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post

# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import api_submit [as 别名]
	def post(self):
		if False == (USER_AGENT in self.request.headers["User-Agent"]):
			self.response.out.write(json.dumps({'success':False}))
			return

		self.response.headers['Content-Type'] = 'application/json'
		facebookid = self.request.get('facebookid')
		account = Account.get_by_facebookid(facebookid)
		params = {}
		params['money'] = self.request.get('money')
		params['candy'] = self.request.get('candy')
		params['score'] = self.request.get('score')
		params['maxscore'] = self.request.get('maxscore')
		params['id'] = self.request.get('id')
		logging.info('coin[%d] candy[%d] score[%d] max[%d]',
				int(params['money']),
				int(params['candy']),
				int(params['score']),
				int(params['maxscore']))
		ret = Account.api_submit(params,account)
#		params['cost'] = self.request.get('candy')
#		params['itemcost'] = self.request.get('money')
#		params['receipt_type'] = 'play'
#		Receipt.new(params,account)
		self.response.headers['Content-Type'] = 'application/json'
		self.response.out.write(json.dumps(ret))
开发者ID:zedoul,项目名称:storyengine-gae,代码行数:28,代码来源:account.py

示例2: post

# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import api_submit [as 别名]
	def post(self):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		testcode = self.request.get('testcode')
		assert(testcode)
		d = json.loads(testcode)
		assert(d)
		params = {}
		params['money'] = d['money']
		params['candy'] = d['candy']
		params['score'] = d['score']
		params['maxscore'] = d['maxscore']
		params['id'] = d['id']
		det = Account.api_submit(params,account)
#		params['cost'] = d['candy']
#		params['itemcost'] = d['money']
#		params['receipt_type'] = 'play'
#		Receipt.new(params,account)
		self.redirect(self.request.url + 'input?result='+str(det))
开发者ID:zedoul,项目名称:storyengine-gae,代码行数:24,代码来源:apitest.py


注:本文中的storyengine.model.account.Account.api_submit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。