This commit is contained in:
aozhiwei 2022-06-22 16:07:25 +08:00
parent e9f7034499
commit 9cd720c4e8
3 changed files with 104 additions and 0 deletions

View File

@ -123,6 +123,56 @@ class Market(object):
['signature', '', 'signature'],
]
},
{
'name': 'getPhase3Box',
'desc': '开启第三阶段奖励',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=getPhase3box',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['token_id', '', '宝箱token_id'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead(),
['!rows', [_common.Phase3Box()], '宝箱信息'],
]
},
{
'name': 'openPhase3Box',
'desc': '开启第三阶段奖励',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=openPhase3Box',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['token_id', '', '宝箱token_id'],
['net_id', '', '网络id'],
['box_id', '', '箱子id'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'queryPhase3Box',
'desc': '查询阶段3开宝箱信息',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=queryPhase3Box',
'params': [
['account', 0, '钱包账号'],
['token', '', 'token'],
['net_id', '', '网络id'],
['box_id', '', '箱子id'],
],
'response': [
_common.RspHead(),
['state', '', '0:开启中 1:开启成功'],
['cec', 0, '奖励cec'],
['!nfts', [_common.NftDetail()], '获得的nft列表'],
]
},
{
'name': 'queryLuckyBox',
'desc': '查询开宝箱信息',

View File

@ -550,3 +550,10 @@ class NftView(object):
['description', '', 'nft描述'],
['image', '', 'nft图片'],
]
class Phase3Box(object):
def __init__(self):
self.fields = [
['box_id', '', '箱子id'],
]

View File

@ -487,4 +487,51 @@ class MarketController extends BaseController {
ActivateNftService::queryResult($account, $tokenId, $netId);
}
public function getPhase3Box()
{
$token = getReqVal('token', '');
$account = getReqVal('account', '');
$tokenId = getReqVal('token_id', '');
$netId = getReqVal('net_id', '');
$account = strtolower(getReqVal('account', ''));
if (!MarketService::isValidToken($account, $token)) {
myself()->_rspErr(1, 'invalid token');
return;
}
$rows = array();
myself()->_rspData(array(
'rows' => $rows
));
}
public function openPhase3Box()
{
$token = getReqVal('token', '');
$account = getReqVal('account', '');
$tokenId = getReqVal('token_id', '');
$netId = getReqVal('net_id', '');
$boxId = getReqVal('box_id', '');
$account = strtolower(getReqVal('account', ''));
if (!MarketService::isValidToken($account, $token)) {
myself()->_rspErr(1, 'invalid token');
return;
}
myself()->_rspOk();
}
public function queryPhase3Box()
{
$token = getReqVal('token', '');
$account = getReqVal('account', '');
$tokenId = getReqVal('token_id', '');
$netId = getReqVal('net_id', '');
$boxId = getReqVal('box_id', '');
$account = strtolower(getReqVal('account', ''));
if (!MarketService::isValidToken($account, $token)) {
myself()->_rspErr(1, 'invalid token');
return;
}
myself()->_rspOk();
}
}