101 lines
3.7 KiB
Python
101 lines
3.7 KiB
Python
# -*- 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': 'buyGoodsS',
|
||
'desc': '购买商品',
|
||
'group': 'Shop',
|
||
'surl': 'webapp/index.php?c=Shop&a=buyGoodsS',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
['goods_id', '', '商品唯一id'],
|
||
['goods_num', 0, '商品数量 如果是宝箱可分为1、10 其他情况的购买为1'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['award', _common.Award(), '奖励信息'],
|
||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'boxPreview',
|
||
'desc': '宝箱道具预览',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=boxPreview',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
['goods_id', 0, '商品唯一id'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['!items', [0], '宝箱物品列表'],
|
||
['free_num', 0, '免费次数'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'queryInAppBalance',
|
||
'desc': '查询当天内购限制余额',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=queryInAppBalance',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['balance', '', '美元'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'inappPurchase',
|
||
'desc': '发起一个内购(购买钻石)',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=inappPurchase',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
['goods_id', '', '商品唯一id'],
|
||
['goods_num', 0, '商品数量'],
|
||
['platform', 0, '平台 1:android 2:ios'],
|
||
],
|
||
'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(),
|
||
['order_id', '', '订单id'],
|
||
['item_id', '', '商品id'],
|
||
['item_num', 0, '商品数量'],
|
||
['status', 0, '订单状态 0:未支付 1:已支付 2:支付失败'],
|
||
]
|
||
},
|
||
]
|