# -*- 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'], ['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': 'startGoodsDirect', 'desc': '发起一个 直接购买(充值,gold)', 'group': 'Shop', 'url': 'webapp/index.php?c=Shop&a=startGoodsDirect', 'params': [ _common.ReqHead(), ['goods_uuid', '', '商品唯一id'], ['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(), ['goods_uuid', '', '商品唯一id'], ['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': '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, '免费次数'], ] } ]