add test Nft

This commit is contained in:
aozhiwei 2022-10-16 09:05:38 +08:00
parent 48ca58070c
commit 81382f07e5

View File

@ -58,6 +58,10 @@ class RestApiController extends BaseController {
myself()->_rspRawData($nftView);
return;
}
if ($this->procTestNft($tokenId, $nftView)){
myself()->_rspRawData($nftView);
return;
}
$nftDb = Nft::getNft($tokenId);
if (empty($nftDb)) {
myself()->_rspRawData($nftView);
@ -67,4 +71,30 @@ class RestApiController extends BaseController {
myself()->_rspRawData($nftView);
}
private function procTestNft($tokenId, &$nftView)
{
$heroBoxes = array(
'6022513565100001',
'6022513565100002',
'6022513565100003',
);
$weaponBoxes = array(
'6022513565100004',
'6022513565100005'
);
if (in_array($tokenId, $heroBoxes)) {
$nftView['name'] = 'CEBG Airdrop Hero';
$nftView['image'] = 'CEBG Airdrop Hero';
$nftView['description'] = 'https://www.cebg.games/res/nfts/CEBG_Space_Hero.png';
return true;
}
if (in_array($tokenId, $weaponBoxes)) {
$nftView['name'] = 'CEBG Airdrop Weapon';
$nftView['image'] = 'CEBG Airdrop Weapon';
$nftView['description'] = 'https://www.cebg.games/res/nfts/CEBG_Space_Weapon.png';
return true;
}
return false;
}
}