game2006api/doc/Shop.py
aozhiwei 77968c8e00 1
2023-07-28 16:54:54 +08:00

133 lines
4.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
import _common
class Shop(object):
def __init__(self):
self.apis = [
{
'name': 'getGoodsList',
'desc': '获取商品列表',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=getGoodsList',
'params': [
_common.ReqHead(),
['shop_id', 0, '商店id'],
],
'response': [
_common.RspHead(),
['!goods_list', [_common.Goods()], '商品列表'],
]
},
{
'name': 'buyGoods',
'desc': '购买商品',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyGoods',
'params': [
_common.ReqHead(),
['goods_uuid', '', '商品唯一id'],
['goods_num', 0, '商品数量'],
],
'response': [
_common.RspHead(),
['award', _common.Award(), '奖励信息'],
['property_chg', _common.PropertyChg(), '属性变更'],
['goods_chg', _common.Goods(), '购买后更新商品的最新信息(可能为null客户端需要做容错处理)'],
]
},
{
'name': 'outappPurchase',
'desc': '发起一个第三方支付(购买钻石)',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=outappPurchase',
'params': [
_common.ReqHead(),
['goods_uuid', '', '商品唯一id'],
['goods_num', 0, '商品数量'],
],
'response': [
_common.RspHead(),
['order_id', '', '订单id'],
]
},
{
'name': 'queryOutappPurchase',
'desc': '查询第三方支付(购买钻石)状态',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=queryOutappPurchase',
'params': [
_common.ReqHead(),
['order_id', '', '订单id'],
],
'response': [
_common.RspHead(),
['item_id', '', '商品id'],
['item_num', 0, '商品数量'],
['status', 0, '订单状态 0:未支付 1:已支付 2:支付失败'],
]
},
{
'name': 'inappPurchase',
'desc': '发起一个内购(购买钻石)',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=inappPurchase',
'params': [
_common.ReqHead(),
['goods_uuid', '', '商品唯一id'],
['goods_num', 0, '商品数量'],
['platform', 0, '平台 1android 2ios'],
],
'response': [
_common.RspHead(),
['order_id', '', '订单id'],
]
},
{
'name': 'queryInappPurchase',
'desc': '查询内购(购买钻石)状态',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=queryInappPurchase',
'params': [
_common.ReqHead(),
['order_id', '', '订单id'],
],
'response': [
_common.RspHead(),
['item_id', '', '商品id'],
['item_num', 0, '商品数量'],
['status', 0, '订单状态 0:未支付 1:已支付 2:支付失败'],
]
},
{
'name': 'getPayMethods',
'desc': '获取支付方式',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=getPayMethods',
'params': [
_common.ReqHead(),
['token_type', 0, "选用币种"],
],
'response': [
_common.RspHead(),
['!pay_methods', [_common.PayMethod()], '支付方式列表'],
]
},
{
'name': 'boxPreview',
'desc': '宝箱道具预览',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=boxPreview',
'params': [
_common.ReqHead(),
['goods_uuid', 0, '商品唯一id'],
],
'response': [
_common.RspHead(),
['!items', [0], '宝箱物品列表'],
['free_num', 0, '免费次数'],
]
}
]