This commit is contained in:
aozhiwei 2022-01-11 13:11:33 +08:00
parent 6dc68804de
commit e3f682521c
2 changed files with 56 additions and 24 deletions

View File

@ -13,7 +13,7 @@ class Market(object):
'url': 'webapp/index.php?c=Market&a=search',
'params': [
['page', 0, '获取第几页数据'],
['type', 0, '0:英雄 1:枪支 2:芯片'],
['type', 0, '0: 系统商店 1: 用户商店'],
['sort', '', '排序字段'],
],
'response': [
@ -28,6 +28,7 @@ class Market(object):
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=buy',
'params': [
['goods_id', '', '商品id'],
],
'response': [
_common.RspHead(),
@ -39,10 +40,11 @@ class Market(object):
'group': 'Market',
'url': 'webapp/index.php?c=Shop&a=detail',
'params': [
['goods_id', '', '商品id'],
],
'response': [
_common.RspHead(),
# ['info', _common.NftDetail(), '商品详细信息'],
['info', _common.NftDetail(), '商品详细信息'],
]
},
]

View File

@ -31,6 +31,15 @@ class Attr(object):
['val', 0, '属性值'],
]
class AttrDesc(object):
def __init__(self):
self.fields = [
['attr_id', 0, '属性id'],
['type', 0, '0: 绝对值 1百分比'],
['val', 0, '属性值'],
]
class SystemCurrency(object):
def __init__(self):
@ -38,7 +47,24 @@ class SystemCurrency(object):
['type', 0, '类型'],
['name', '', '类型'],
['value', 0, ''],
['decimals', 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, '精度'],
['contract_address', 0, '合约地址'],
['enabled', 0, 'enabled'],
], '支付token'],
]
class Page(object):
@ -400,36 +426,40 @@ class NftHero(object):
def __init__(self):
self.fields = [
['name', '', '英雄名'],
['!attr', [AttrDesc()], '属性'],
]
class NftGun(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, '状态'],
['ref_id', '', '引用id?'],
['ref_type', 0, '引用类型?'],
['owner_address', '', '所有者地址'],
['owner_id', '', '所有者'],
['image_avatar', '', '图片'],
['image_full', '', '图片-全'],
['price', 0, '价格'],
['system_currency', SystemCurrency(), '系统货币'],
['price', SystemCurrency(), '价格'],
['info', Union([
[NftHero(), '英雄'],
[NftGun(), '枪支'],
@ -443,46 +473,46 @@ class NftHeroDetail(object):
def __init__(self):
self.fields = [
['name', '', '英雄名'],
['!attr', [AttrDesc()], '属性'],
]
class NftGunDetail(object):
def __init__(self):
self.fields = [
['name', '', '枪支名'],
['!attr', [AttrDesc()], '属性'],
]
class NftChipDetail(object):
def __init__(self):
self.fields = [
['name', '', '芯片名'],
['!attr', [AttrDesc()], '属性'],
]
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, '状态'],
['ref_id', '', '用id?'],
['ref_type', 0, '引用类型?'],
['user_id', '', 'id'],
['user_using_id', '', '用户using id'],
['owner_address', '', '所有者地址'],
['owner_id', '', '所有者'],
['image_avatar', '', '图片'],
['image_full', '', '图片-全'],
['price', 0, '价格'],
['system_currency', [
['type', 0, '类型'],
['name', '', '类型'],
['value', 0, ''],
['decimals', 0, ''],
], '系统货币'],
# ['info', [
# ['info0', NftHeroDetail(), '英雄'],
# ['info1', NftGunDetail(), '枪支'],
# ['info2', NftChipDetail(), '芯片'],
# ], 'nft信息'],
['owner_name', '', '所有名字'],
['sale', Sale(), '售卖信息'],
['last_price', SystemCurrency(), '最后一次售卖价格'],
['info', Union([
[NftHeroDetail(), '英雄'],
[NftGunDetail(), '枪支'],
[NftChipDetail(), '芯片'],
]), 'nft详细信息'],
['created_at', 0, '创建时间(utc时间)'],
['last_modified_at', 0, '最后修改时间(utc时间)'],
]