343 lines
13 KiB
Python
343 lines
13 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(),
|
||
['shop_id', 0, '商店id 0: 所有商店(较慢)'],
|
||
],
|
||
'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': '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'],
|
||
['records' [_common.InappPurchaseRecord()], '购买记录'],
|
||
],
|
||
'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': 'getDailySelectionList',
|
||
'desc': '获取每日精选列表',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=getDailySelectionList',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['idx', 0, '每日精选的索引'],
|
||
['refresh_info', '', '每日精选的刷新信息(格式:刷新次数/可刷新总数)'],
|
||
['cost', 0, '每日精选的当前刷新价格,-1表示不可刷新'],
|
||
['!goods_list', [_common.DailySelectionGoods()], '每日精选列表'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'refreshDailySelection',
|
||
'desc': '刷新每日精选',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=refreshDailySelection',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['cost', 0, '每日精选的当前刷新价格'],
|
||
]
|
||
},
|
||
{
|
||
'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()], '盲盒结果列表'],
|
||
]
|
||
},
|
||
{
|
||
'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, '购买中...'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'openBlindBox',
|
||
'desc': '打开盲盒',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=openBlindBox',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
['item_id', 0, '宝箱物品id item_id'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['!items', [_common.BlindBoxResult()], '宝箱物品列表'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'getMyBlindBoxs',
|
||
'desc': '获取我的盲盒列表',
|
||
'group': 'Shop',
|
||
'url': 'webapp/index.php?c=Shop&a=getMyBlindBoxs',
|
||
'params': [
|
||
_common.ReqHead(),
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['!items', [0], '盲盒列表'],
|
||
]
|
||
},
|
||
|
||
]
|