This commit is contained in:
aozhiwei 2022-11-02 12:10:14 +08:00
parent d26706ed4d
commit ac5932afe6
3 changed files with 34 additions and 88 deletions

View File

@ -18,6 +18,19 @@ class BlockChain(object):
['!transactions', [_common.NftTransaction()], '交易列表']
]
},
{
'name': 'reportResult',
'desc': '上报链调用结果',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=reportResult',
'params': [
['trans_id', '', '事务id'],
['result', '', '合约返回值'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'active721Nft',
'desc': '激活721nft',
@ -47,19 +60,6 @@ class BlockChain(object):
['!params', [''], '合约参数列表'],
]
},
{
'name': 'reportActiveResult',
'desc': '上报激活结果',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=reportActiveResult',
'params': [
['trans_id', '', '事务id'],
['result', '', '合约返回值'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'evolve721Nft',
'desc': 'nft进阶(英雄,武器)',
@ -76,19 +76,6 @@ class BlockChain(object):
['!params', [''], '合约参数列表'],
]
},
{
'name': 'reportEvolve721NftResult',
'desc': '上报nft进阶(英雄、武器)结果',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=reportEvolve721NftResult',
'params': [
['trans_id', '', '事务id'],
['result', '', '合约返回值'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'evolveChip',
'desc': '芯片进阶',
@ -104,19 +91,6 @@ class BlockChain(object):
['!params', [''], '合约参数列表'],
]
},
{
'name': 'reportEvolveChipResult',
'desc': '上报芯片进阶结果',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=reportEvolveChipResult',
'params': [
['trans_id', '', '事务id'],
['result', '', '合约返回值'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'mintShardBatchUser',
'desc': '碎片生成',
@ -131,19 +105,6 @@ class BlockChain(object):
['!params', [''], '合约参数列表'],
]
},
{
'name': 'reportMintShardBatchUserResult',
'desc': '上报碎片生成结果',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=reportMintShardBatchUserResult',
'params': [
['trans_id', '', '事务id'],
['result', '', '合约返回值'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'shardMixByUser',
'desc': '碎片合成',
@ -158,18 +119,5 @@ class BlockChain(object):
['trans_id', '', '事务id'],
['!params', [''], '合约参数列表'],
]
},
{
'name': 'reportShardMixByUserUserResult',
'desc': '上报碎片合成结果',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=reportShardMixByUserResult',
'params': [
['trans_id', '', '事务id'],
['result', '', '合约返回值'],
],
'response': [
_common.RspHead(),
]
},
}
]

View File

@ -106,9 +106,12 @@ class BlockChainController extends BaseAuthedController {
}
public function reportActiveResult()
public function reportResult()
{
$transId = getReqVal('trans_id', '');
$result = getReqVal('result', '');
Transaction::reportResult($transId, $result);
myself()->_rspOk();
}
public function evolve721Nft()
@ -116,41 +119,21 @@ class BlockChainController extends BaseAuthedController {
}
public function reportEvolve721NftResult()
{
}
public function evolveChip()
{
}
public function reportEvolveChipResult()
{
}
public function mintShardBatchUser()
{
}
public function reportMintShardBatchUserResult()
{
}
public function shardMixByUser()
{
}
public function reportShardMixByUserResult()
{
}
private function internalActivate721Nft($tokenId, $tokenType, $itemUniId, $itemId)
{
$params = array(

View File

@ -120,4 +120,19 @@ class Transaction extends BaseModel {
}
}
public static function reportResult($transId, $result)
{
SqlHelper::update(
myself()->_getSelfMysql(),
't_transaction',
array(
'account_id' => myself()->_getAccountId(),
'trans_id' => $transId
),
array(
'client_result' => $result
)
);
}
}