Merge branch 'james' of git.kingsome.cn:server/game2006api into james

This commit is contained in:
hujiabin 2022-10-31 20:28:53 +08:00
commit 65df9e1a0c
5 changed files with 275 additions and 7 deletions

View File

@ -7,30 +7,169 @@ class BlockChain(object):
def __init__(self):
self.apis = [
{
'name': 'activeNft',
'desc': '激活nft',
'name': 'getTransactionList',
'desc': '获取列交易列表',
'group': 'BlockChain',
'url': 'webapp/index.php?c=ActiveNft&a=activeNft',
'url': 'webapp/index.php?c=BlockChain&a=getTransactionList',
'params': [
],
'response': [
_common.RspHead(),
['!transactions', [_common.NftTransaction()], '交易列表']
]
},
{
'name': 'active721Nft',
'desc': '激活721nft',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=active721Nft',
'params': [
['type', 0, '1英雄 2枪械'],
['uniid', 0, '唯一id'],
],
'response': [
_common.RspHead(),
['trans_id', '', '事务id'],
['!params', [''], '合约参数列表'],
]
},
{
'name': 'active1155Nft',
'desc': '激活721nft',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=active1155Nft',
'params': [
['trans_id', '', '事务id'],
],
'response': [
_common.RspHead(),
['trans_id', '', '事务id'],
['!params', [''], '合约参数列表'],
]
},
{
'name': 'reportActiveResult',
'desc': '上报激活结果',
'group': 'BlockChain',
'url': 'webapp/index.php?c=ActiveNft&a=reportActiveResult',
'url': 'webapp/index.php?c=BlockChain&a=reportActiveResult',
'params': [
['type', 0, '1英雄 2枪械'],
['uniid', 0, '唯一id'],
['trans_id', '', '事务id'],
['result', '', '合约返回值'],
],
'response': [
_common.RspHead(),
]
},
{
'name': 'evolve721Nft',
'desc': 'nft进阶(英雄,武器)',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=evolve721Nft',
'params': [
['type', 0, '1英雄 2枪械'],
['token_id1', 0, 'tokenid1'],
['token_id2', 0, 'tokenid2'],
],
'response': [
_common.RspHead(),
['trans_id', '', '事务id'],
['!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': '芯片进阶',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=evolveChip',
'params': [
['token_id1', 0, 'tokenid1'],
['token_ids', '', 'tokenids材料id(|分割)'],
],
'response': [
_common.RspHead(),
['trans_id', '', '事务id'],
['!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': '碎片生成',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=mintShardBatchUser',
'params': [
['ids', 0, 'tokenid1'],
],
'response': [
_common.RspHead(),
['trans_id', '', '事务id'],
['!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': '碎片合成',
'group': 'BlockChain',
'url': 'webapp/index.php?c=BlockChain&a=shardMixByUser',
'params': [
['token_id1', 0, 'tokenid1'],
['token_id2', 0, 'tokenid2'],
],
'response': [
_common.RspHead(),
['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

@ -52,4 +52,17 @@ class Shop(object):
['!goods_list', [_common.DiscountInfo()], '折扣的商品列表'],
]
},
{
'name': 'getStageList',
'desc': '获取指定层级的商店id列表',
'group': 'Shop',
'url': 'webapp/index.php?c=Shop&a=getStageList',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['!shop_id_list', [0], '1:Recommend 2:Hero 3:Weapon 4:Chip 5:Consume']
]
}
]

View File

@ -926,3 +926,13 @@ class BattleHistory(object):
['pve_instance_id', 0, 'pve副本难度id'],
['pve_instance_mode', 0, 'pve副本mode'],
]
class NftTransaction(object):
def __init__(self):
self.fields = [
['item_id', 0, '道具id'],
['action', 0, '动作'],
['time', 0, '时间'],
['status', 0, '1:已完成 2:等待中'],
]

View File

@ -777,3 +777,23 @@ CREATE TABLE `t_parachute` (
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `t_transaction`
--
DROP TABLE IF EXISTS `t_transaction`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_transaction` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`trans_id` varchar(255) NOT NULL DEFAULT '' COMMENT '事务id',
`action` int(11) NOT NULL DEFAULT '0' COMMENT 'action',
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
`status` int(11) NOT NULL DEFAULT '0' COMMENT 'status',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -0,0 +1,86 @@
<?php
require_once('mt/Parameter.php');
require_once('mt/Item.php');
require_once('mt/Drop.php');
require_once('mt/Hero.php');
require_once('models/Bag.php');
require_once('models/Hero.php');
require_once('models/Gun.php');
require_once('models/Nft.php');
require_once('services/AwardService.php');
require_once('services/PropertyChgService.php');
require_once('services/NameService.php');
use phpcommon\SqlHelper;
use models\Bag;
use models\Hero;
use models\Gun;
use models\Nft;
class BlockChainController extends BaseAuthedController {
public function getTransactionList()
{
}
public function active721Nft()
{
}
public function active1155Nft()
{
}
public function reportActiveResult()
{
}
public function evolve721Nft()
{
}
public function reportEvolve721NftResult()
{
}
public function evolveChip()
{
}
public function reportEvolveChipResult()
{
}
public function mintShardBatchUser()
{
}
public function reportMintShardBatchUserResult()
{
}
public function shardMixByUser()
{
}
public function reportShardMixByUserResult()
{
}
}