game2006api/doc/Shop.py
songliang 32b25aa996 ...
2023-06-28 17:22:52 +08:00

237 lines
9.2 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': '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': 'buyGoodsNormal',
'desc': '购买商品(正式)',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyGoodsNormal',
'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.NewGoods(), '购买后更新商品的最新信息(可能为null客户端需要做容错处理)'],
]
},
{
'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': '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': 'getDailySelectionList',
'desc': '获取每日精选列表',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=getDailySelectionList',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['idx', 0, '每日精选的索引'],
['cost', 0, '每日精选的当前刷新价格'],
['!goods_list', [_common.DailySelectionGoods()], '每日精选列表'],
]
},
{
'name': 'refreshDailySelection',
'desc': '刷新每日精选',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=refreshDailySelection',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'name': 'buyGoodsDS',
'desc': '购买每日精选商品',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=buyGoodsDS',
'params': [
_common.ReqHead(),
['idx', 0, '每日精选的索引'],
['grid', 0, '商品在每日精选中的位置索引'],
['count', 0, '购买数量,始终是1'],
],
'response': [
_common.RspHead(),
['block_chain', _common.ShopTrans(), '链上购买订单信息']
]
},
{
'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()], '盲盒结果列表'],
]
}
]