diff --git a/doc/Staking.py b/doc/Staking.py index 449730d9..6f1ca9a9 100644 --- a/doc/Staking.py +++ b/doc/Staking.py @@ -68,4 +68,21 @@ class Staking(object): ['cec_rewards', 0, '该nft结算得到的ceg数量'], ] }, + { + 'name': 'stakingPreview', + 'desc': '质押预览', + 'group': 'Staking', + 'url': 'webapp/index.php?c=Staking&a=stakingPreview', + 'params': [ + _common.ReqHead(), + ['token_id_list', '', 'token_id多个|分割'], + ['contract_address_list', '', 'contract_address多个|分割'], + ['net_id', '', 'net_id'], + ], + 'response': [ + _common.RspHead(), + ['nft_value', 0, 'nft价值'], + ['!items', [_common.StakingPreview()], ''], + ] + }, ] diff --git a/doc/_common.py b/doc/_common.py index d2b8fb31..ca5b28da 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -1454,3 +1454,11 @@ class StakingDetail(object): ['stacked_days', 0, '该nft质押的总天数'], ['remain_days', 0, '该nft剩余质押天数'], ] + +class StakingPreview(object): + + def __init__(self): + self.fields = [ + ['time', 0, '天数'], + ['interest', 0, '利息'], + ] diff --git a/webapp/controller/StakingController.class.php b/webapp/controller/StakingController.class.php index c5a444f8..45fb32ab 100644 --- a/webapp/controller/StakingController.class.php +++ b/webapp/controller/StakingController.class.php @@ -112,6 +112,16 @@ class StakingController extends BaseAuthedController { $transId = getReqVal('trans_id', 0); } + public function stakingPreview() + { + $tokenIdList = getReqVal('token_id_list', ''); + $contractAddressList = getReqVal('contract_address_list', ''); + $netId = getReqVal('net_id', ''); + { + $nftList = Nft::getNftList(myself()-_getAddress()); + } + } + private function isTypeNft($type, $dbInfo) { switch ($type) {