From 03b72f8195c255ffe9325ca68e8be908ae8a4a39 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Wed, 18 Oct 2023 14:24:13 +0800 Subject: [PATCH] 1 --- doc/OutAppNft.py | 39 +++++++++++++++++ .../controller/OutAppNftController.class.php | 42 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 doc/OutAppNft.py create mode 100644 webapp/controller/OutAppNftController.class.php diff --git a/doc/OutAppNft.py b/doc/OutAppNft.py new file mode 100644 index 00000000..4b86f46b --- /dev/null +++ b/doc/OutAppNft.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +import _common + +class OutAppNft(object): + + def __init__(self): + self.apis = [ + { + 'name': 'getNftList', + 'desc': 'nft列表', + 'group': 'OutAppNft', + 'url': 'webapp/index.php?c=OutAppNft&a=getNftList', + 'params': [ + ['address', '', '钱包地址'], + ['type', 0, '类型 1:英雄 6:gacha 7:勋章 8:星球'], + ], + 'response': [ + _common.RspHead(), + ['!nfts', [NftInfo()], 'nft列表'], + ] + }, + ] + + +class NftInfo(object): + + def __init__(self): + self.fields = [ + ['idx', 0, 'idx'], + ['owner_address', '', '钱包地址'], + ['item_id', 0, 'item_id'], + ['token_id', 0, 'token_id'], + ['token_type', 0, 'token_type'], + ['contract_address', '', '合约地址'], + ['image', '', '头像立绘'], + ['full_image', '', '全身立绘'], + ['!details', [], '详细'], + ] \ No newline at end of file diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php new file mode 100644 index 00000000..b1fbbc24 --- /dev/null +++ b/webapp/controller/OutAppNftController.class.php @@ -0,0 +1,42 @@ + $nft['idx'], + "owner_address" => $nft['owner_address'], + "item_id" => $nft['item_id'], + "token_id" => $nft['token_id'], + "token_type" => $nft['token_type'], + "contract_address" => $nft['contract_address'], + 'image' => $image, + 'full_image' => $full_image, + "details" => array(), + ); + array_push($listInfo,$info); + } + } + + $this->_rspData(array( + 'nfts' => $listInfo, + )); + + } +} +