61 lines
2.4 KiB
Python
61 lines
2.4 KiB
Python
# -*- coding: utf-8 -*-
|
||
|
||
import _common
|
||
|
||
class BcShop(object):
|
||
|
||
def __init__(self):
|
||
self.apis = [
|
||
{
|
||
'name': 'search',
|
||
'desc': '获取出售的商品列表',
|
||
'group': 'BcShop',
|
||
'url': 'webapp/index.php?c=BcShop&a=search',
|
||
'params': [
|
||
['account', 0, '钱包账号'],
|
||
['page', 0, '获取第几页数据'],
|
||
['sort', '', '排序字段'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['!rows', [_common.PreSaleBox()], '商品信息'],
|
||
['page', _common.Page(), '分页信息'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'buy',
|
||
'desc': '购买',
|
||
'group': 'BcShop',
|
||
'url': 'webapp/index.php?c=BcShop&a=buy',
|
||
'params': [
|
||
['token', '', 'token'],
|
||
['type', '', '注意是箱子id!!!(box_id)'],
|
||
['buyer_address', '', '购买者账号id'],
|
||
['price', '', 'price'],
|
||
['payment_token_address', '', 'payment_token_address'],
|
||
['nonce', '', 'nonce'],
|
||
['signature', '', '签名soliditySha3(type, payment_token_address, price, nonce), 签名的replace客户端做处理'],
|
||
['net_id', '', '网络id'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(),
|
||
['order_id', '', '订单号(errcode = 0的时候,根据订单号客户端定时调用queryOrder接口)查询状态'],
|
||
]
|
||
},
|
||
{
|
||
'name': 'queryOrder',
|
||
'desc': '查询订单状态',
|
||
'group': 'BcShop',
|
||
'url': 'webapp/index.php?c=BcShop&a=queryOrder',
|
||
'params': [
|
||
['account', 0, '钱包账号'],
|
||
['token', '', 'token'],
|
||
['order_id', 0, '订单id'],
|
||
],
|
||
'response': [
|
||
_common.RspHead(errcode='当errcode!=0的时候客户端不需要再调用(停止定时器)'),
|
||
['state', 0, '0:订单不存在 1:购买成功 2:交易处理中 3:交易失败'],
|
||
]
|
||
},
|
||
]
|