117 lines
4.3 KiB
Python
117 lines
4.3 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()], '折扣的商品列表'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'getGoodsList',
|
||
'desc': '获取商品列表',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=getGoodsList',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['!goods_list', [_common.NewGoods()], '商品列表'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'getShopNames',
|
||
'desc': '获取商店名称',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=getShopNames',
|
||
'params': [
|
||
_common.ReqHead()
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['!shop_name_list', [_common.ShopName()], '商店id名字对应表']
|
||
]
|
||
},
|
||
{
|
||
'name': 'buyGoodsNew',
|
||
'desc': '购买商品(新)',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=buyGoodsNew',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
['id', 0, '商品唯一id,参见shopGoods表'],
|
||
['token_type', '', "选用币种"],
|
||
['goods_num', 0, '商品数量'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['award', _common.Award(), '奖励信息'],
|
||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||
['goods_chg', _common.NewGoods(), '购买后更新商品的最新信息(可能为null客户端需要做容错处理)'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'buyGoodsDirect',
|
||
'desc': '直接购买(充值,gold)',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=buyGoodsDirect',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
['id', 0, '商品唯一id,参见shopGoods表'],
|
||
['token_type', '', "选用币种"],
|
||
['goods_num', 0, '商品数量'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
]
|
||
},
|
||
|
||
|
||
]
|