From 81382f07e564589ce6c1949762b798f40ff004a8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 16 Oct 2022 09:05:38 +0800 Subject: [PATCH] add test Nft --- webapp/controller/RestApiController.class.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/webapp/controller/RestApiController.class.php b/webapp/controller/RestApiController.class.php index 5aa14089..369b40b6 100644 --- a/webapp/controller/RestApiController.class.php +++ b/webapp/controller/RestApiController.class.php @@ -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; + } + }