This commit is contained in:
aozhiwei 2022-01-25 15:32:29 +08:00
parent dc28d97566
commit af63f4e5af
2 changed files with 58 additions and 100 deletions

View File

@ -7,66 +7,56 @@ class Market(object):
def __init__(self): def __init__(self):
self.apis = [ self.apis = [
{ {
'name': 'search', 'name': 'searchBox',
'desc': '获取商店信息', 'desc': '获取预售商品信息',
'group': 'Market', 'group': 'Market',
'url': 'webapp/index.php?c=Market&a=search', 'url': 'webapp/index.php?c=Market&a=searchBox',
'params': [ 'params': [
['account', 0, '钱包账号'],
['page', 0, '获取第几页数据'], ['page', 0, '获取第几页数据'],
['type', 0, '0: 系统商店 1: 用户商店'],
['sort', '', '排序字段'], ['sort', '', '排序字段'],
], ],
'response': [ 'response': [
_common.RspHead(), _common.RspHead(),
['!rows', [_common.Nft()], '商品信息'], ['!rows', [_common.PreSaleBox()], '商品信息'],
['page', _common.Page(), '分页信息'], ['page', _common.Page(), '分页信息'],
['presale_info', _common.PreSaleInfo(), '预售信息'],
] ]
}, },
{ {
'name': 'buy', 'name': 'buyBox',
'desc': '购买', 'desc': '购买箱子',
'group': 'Market', 'group': 'Market',
'url': 'webapp/index.php?c=Market&a=buy', 'url': 'webapp/index.php?c=Market&a=buyBox',
'params': [ 'params': [
['account', '', '账号id'], ['account', '', '账号id'],
['goods_id', '', '商品id'], ['box_id', '', '箱子id'],
], ],
'response': [ 'response': [
_common.RspHead(), _common.RspHead(),
] ]
}, },
{ {
'name': 'prebuy', 'name': 'getNftList',
'desc': '预购', 'desc': '获取账号对应的nft列表',
'group': 'Market', 'group': 'Market',
'url': 'webapp/index.php?c=Market&a=prebuy', 'url': 'webapp/index.php?c=Market&a=getMyNftList',
'params': [ 'params': [
['account', '', '账号id'], ['account', '', '账号id'],
['goods_id', '', '商品id'],
], ],
'response': [ 'response': [
_common.RspHead(), _common.RspHead(),
['!nfts', [_common.NftDetail()], 'nft列表'],
] ]
}, },
{ {
'name': 'sell', 'name': 'getNftDetail',
'desc': '出售',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=sell',
'params': [
['goods_id', '', '商品id'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'detail',
'desc': '获取商品详情', 'desc': '获取商品详情',
'group': 'Market', 'group': 'Market',
'url': 'webapp/index.php?c=Shop&a=detail', 'url': 'webapp/index.php?c=Market&a=getNftDetail',
'params': [ 'params': [
['goods_id', '', '商品id'], ['account', '', '账号id'],
['token_id', '', 'token_id'],
], ],
'response': [ 'response': [
_common.RspHead(), _common.RspHead(),

View File

@ -44,27 +44,11 @@ class SystemCurrency(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
['type', 0, '类型'], ['name', '', '货币名称'],
['name', '', '类型'], ['original price', 0, '原价'],
['value', 0, ''], ['discount_price', 0, '折后价'],
['decimals', 0, '精度'], ['discount_rate', 0, '折扣百分比0-100'],
] ['contract_address', 0, '合约地址'],
class Sale(object):
def __init__(self):
self.fields = [
['price', SystemCurrency(), '价格'],
['payment_token', [
['id', '', ''],
['created_at', 0, '创建utc时间'],
['last_modified_at', 0, '最后修改utc时间'],
['name', '', '名称'],
['symbol', '', 'symbol'],
['decimals', 0, '精度'],
['contract_address', 0, '合约地址'],
['enabled', 0, 'enabled'],
], '支付token'],
] ]
class Page(object): class Page(object):
@ -422,52 +406,25 @@ class TeamInfo(object):
['!member_list', [TeamMember()], '队伍成员列表(包含自己)'], ['!member_list', [TeamMember()], '队伍成员列表(包含自己)'],
] ]
class NftHero(object): class PreSaleInfo(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
['name', '', '英雄名'], ['batch_id', 0, '批次id(目前客户端没用到先不用管)'],
['!attr', [AttrDesc()], '属性'], ['countdown', 0, '预售倒计时'],
['sold_num', 0, '已售数'],
['inventory_num', 0, '库存数'],
['hint', '', '预售文字描述'],
['buyed', 0, '自己是否已购'],
] ]
class NftGun(object): class PreSaleBox(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
['name', '', '枪支名'], ['box_id', '', '箱子id'],
['!attr', [AttrDesc()], '属性'], ['item_id', 0, '道具id(根据这个读取箱子的图片)'],
] ['!currency_list', [SystemCurrency()], '货币列表,(目前有且只有一个)'],
class NftChip(object):
def __init__(self):
self.fields = [
['name', '', '芯片名'],
['!attr', [AttrDesc()], '属性'],
]
class Nft(object):
def __init__(self):
self.fields = [
['goods_id', '', '商品id'],
['nft_id', '', 'nft id'],
['type', 0, '类型 0:英雄 1:枪支 2:芯片'],
['token_id', '', '代币id?'],
['status', 0, '状态'],
['inventory', 0, '库存(剩余数量)'],
['owner_address', '', '所有者地址'],
['owner_id', '', '所有者'],
['image_avatar', '', '图片'],
['image_full', '', '图片-全'],
['price', SystemCurrency(), '价格'],
['info', Union([
[NftHero(), '英雄'],
[NftGun(), '枪支'],
[NftChip(), '芯片'],
]), 'nft信息'],
['created_at', 0, '创建时间(utc时间)'],
['last_modified_at', 0, '最后修改时间(utc时间)'],
] ]
class NftHeroDetail(object): class NftHeroDetail(object):
@ -475,7 +432,16 @@ class NftHeroDetail(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
['name', '', '英雄名'], ['name', '', '英雄名'],
['!attr', [AttrDesc()], '属性'], ['level', 0, '等级'],
['quality', 0, '星级'],
['name', '', '英雄名'],
['hp', 0, '血量'],
['speed', 0, '速度'],
['atk', 0, '攻击'],
['def', 0, '防御'],
['advanced_count', 0, '升级次数'],
['lukcy', 0, '幸运'],
['success_rate', 0, '成功率'],
] ]
class NftGunDetail(object): class NftGunDetail(object):
@ -494,26 +460,28 @@ class NftChipDetail(object):
['!attr', [AttrDesc()], '属性'], ['!attr', [AttrDesc()], '属性'],
] ]
class TransactionRecrod(object):
def __init__(self):
self.fields = [
['from', '', '来源钱包'],
['date', 0, '交易日期(utc时间)'],
]
class NftDetail(object): class NftDetail(object):
def __init__(self): def __init__(self):
self.fields = [ self.fields = [
['goods_id', '', '商品id'], ['token_id', '', 'token id'],
['nft_id', '', 'nft id'],
['type', 0, '类型 0:英雄 1:枪支 2:芯片'],
['token_id', '', '代币id?'],
['status', 0, '状态'],
['user_id', '', '用户id'],
['user_using_id', '', '用户using id'],
['owner_address', '', '所有者地址'], ['owner_address', '', '所有者地址'],
['owner_name', '', '所有名字'], ['owner_name', '', '所有名字'],
['sale', Sale(), '售卖信息'], ['item_id', 0, '道具id'],
['last_price', SystemCurrency(), '最后一次售卖价格'],
['info', Union([ ['info', Union([
[NftHeroDetail(), '英雄'], [NftHeroDetail(), '英雄'],
[NftGunDetail(), '枪支'], [NftGunDetail(), '枪支'],
[NftChipDetail(), '芯片'], [NftChipDetail(), '芯片'],
]), 'nft详细信息'], ]), 'nft详细信息'],
['created_at', 0, '创建时间(utc时间)'], ['!transaction_recrod', [TransactionRecrod()], '交易记录'],
['last_modified_at', 0, '最后修改时间(utc时间)'], ['!currency_list', [SystemCurrency()], '货币列表,(目前有且只有一个)'],
['mint_time', 0, '铸造时间'],
] ]