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

View File

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