game2005api/doc/Shop.py
2021-12-01 15:06:46 +08:00

56 lines
2.0 KiB
Python

# -*- coding: utf-8 -*-
import _common
class Shop(object):
def __init__(self):
self.apis = [
{
'name': 'info',
'desc': '获取商店信息',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=info',
'params': [
_common.ReqHead(),
['shop_id', '', '商店id shop_id=100:商店外购买'],
],
'response': [
_common.RspHead(),
['info', _common.Shop(), '商店信息'],
]
},
{
'name': 'buyGoods',
'desc': '购买商品',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyGoods',
'params': [
_common.ReqHead(),
['shop_id', 0, '商店id shop_id=100特殊商店id'],
['goods_id', 0, '商品id'],
['goods_num', 0, '商品数量'],
['cost_item_id', 0, '支付方式'],
],
'response': [
_common.RspHead(),
['award', _common.Award(), '奖励信息'],
['property_chg', _common.PropertyChg(), '属性变更'],
['goods_chg', _common.Goods(), '购买后更新商品的最新信息(可能为null客户端需要做容错处理)'],
]
},
{
'name': 'getDiscountList',
'desc': '获取商品折扣列表',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=getDiscountList',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['!goods_list', [_common.DiscountInfo()], '折扣的商品列表'],
]
},
]