game2006api/doc/Shop.py
aozhiwei 915aa9f721 1
2023-07-27 15:28:36 +08:00

197 lines
7.5 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 0: 所有商店(较慢)'],
],
'response': [
_common.RspHead(),
['!goods_list', [_common.Goods()], '商品列表'],
]
},
{
'name': 'buyGoods',
'desc': '购买商品',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyGoods',
'params': [
_common.ReqHead(),
['id', 0, '商品唯一id参见shopGoods表'],
['token_type', '', "选用币种"],
['goods_num', 0, '商品数量'],
],
'response': [
_common.RspHead(),
['block_chain', _common.ShopTrans(), '链上购买订单信息'],
['award', _common.Award(), '奖励信息'],
['property_chg', _common.PropertyChg(), '属性变更'],
['goods_chg', _common.Goods(), '购买后更新商品的最新信息(可能为null客户端需要做容错处理)'],
]
},
{
'name': 'buyDiamond',
'desc': '购买钻石',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyDiamond',
'params': [
_common.ReqHead(),
['num', 0, '购买数量'],
],
'response': [
_common.RspHead(),
['block_chain', _common.ShopTrans(), '链上购买订单信息'],
]
},
{
'name': 'buyGoodsDirect',
'desc': '直接购买(充值,gold)',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyGoodsDirect',
'params': [
['account_id', '', '账号id'],
['order_id', '', '订单id'],
['id', 0, '商品唯一id参见shopGoods表'],
['token_type', '', "选用币种"],
['goods_num', 0, '商品数量'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'startGoodsDirect',
'desc': '发起一个 直接购买(充值,gold)',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=startGoodsDirect',
'params': [
_common.ReqHead(),
['id', 0, '商品唯一id参见shopGoods表'],
['token_type', '', "选用币种"],
['goods_num', 0, '商品数量'],
],
'response': [
_common.RspHead(),
['order_id', '', '订单id'],
]
},
{
'name': 'statusGoodsDirect',
'desc': '查询 直接购买(充值,gold) 状态',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=statusGoodsDirect',
'params': [
_common.ReqHead(),
['order_id', '', '订单id'],
],
'response': [
_common.RspHead(),
['status', 0, '订单状态 0:未支付 1:已支付 2:支付失败'],
]
},
{
'name': 'startInappPurchase',
'desc': '发起一个内购(购买钻石)',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=startInappPurchase',
'params': [
_common.ReqHead(),
['id', 0, '商品唯一id参见shopGoods表'],
['goods_num', 0, '商品数量'],
],
'response': [
_common.RspHead(),
['order_id', '', '订单id'],
]
},
{
'name': 'statusInappPurchase',
'desc': '查询内购(购买钻石)状态',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=statusInappPurchase',
'params': [
_common.ReqHead(),
['order_id', '', '订单id'],
],
'response': [
_common.RspHead(),
['item_id', '', '商品id'],
['item_num', 0, '商品数量'],
['status', 0, '订单状态 0:未支付 1:已支付 2:支付失败'],
]
},
{
'name':'inappPurchaseDiamonds',
'desc': '内购回调',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=inappPurchaseDiamonds',
'params': [
['channel', '', '渠道 goole or apple'],
['sign', '', '签名'],
['records', '', '购买记录,以下字段是一个record的表示'],
['productId', '', '商品id'],
['gameOrderId', '', '游戏订单id'],
['orderId', '', 'google订单id'],
['status', 0, '订单状态'],
],
'response': [
_common.RspHead(),
]
},
{
'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': 'buyBlindBox',
'desc': '购买盲盒(宝箱)',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyBlindBox',
'params': [
_common.ReqHead(),
['id', 0, '商品唯一id参见shopGoods表'],
['num', 0, '购买数量 1:单个 10:十连抽'],
],
'response': [
_common.RspHead(),
['!result', [_common.BlindBoxResult()], '盲盒结果列表'],
]
},
{
'name': 'getChestItems',
'desc': '获取宝箱可能出现的物品列表',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=getChestItems',
'params': [
_common.ReqHead(),
['id', 0, '商品唯一id参见shopGoods表'],
],
'response': [
_common.RspHead(),
['!items', [0], '宝箱物品列表'],
['free_num', 0, '免费次数'],
['pending', 0, '购买中...'],
]
}
]