From 5f5f219555b2b633eb77005115f11823e85d8c46 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 31 Oct 2022 19:14:40 +0800 Subject: [PATCH 1/7] 1 --- doc/BlockChain.py | 140 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 135 insertions(+), 5 deletions(-) diff --git a/doc/BlockChain.py b/doc/BlockChain.py index e525d7f6..6c44fc9f 100644 --- a/doc/BlockChain.py +++ b/doc/BlockChain.py @@ -7,26 +7,156 @@ class BlockChain(object): def __init__(self): self.apis = [ { - 'name': 'activeNft', - 'desc': '激活nft', + 'name': 'active721Nft', + 'desc': '激活721nft', 'group': 'BlockChain', - 'url': 'webapp/index.php?c=ActiveNft&a=activeNft', + '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': [ + ['type', 0, '1:英雄 2:枪械'], + ['uniid', 0, '唯一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': [ + ['trans_id', '', '事务id'], + ['result', '', '合约返回值'], + ], + 'response': [ + _common.RspHead(), + ] + }, + { + 'name': 'evolve721Nft', + 'desc': 'nft进阶(英雄,武器)', + 'group': 'BlockChain', + 'url': 'webapp/index.php?c=BlockChain&a=active1155Nft', 'params': [ ['type', 0, '1:英雄 2:枪械'], - ['uniid', 0, '唯一id'], + ['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_id2', 0, 'tokenid2'], + ], + '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': [ + ['token_id1', 0, 'tokenid1'], + ['token_id2', 0, 'tokenid2'], + ], + '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(), From b7c49c93726dd1527b864d152a8bef7a329522d2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 31 Oct 2022 19:18:09 +0800 Subject: [PATCH 2/7] 1 --- doc/BlockChain.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/BlockChain.py b/doc/BlockChain.py index 6c44fc9f..3738bab8 100644 --- a/doc/BlockChain.py +++ b/doc/BlockChain.py @@ -6,6 +6,17 @@ class BlockChain(object): def __init__(self): self.apis = [ + { + 'name': 'getTransactionList', + 'desc': '获取列交易列表', + 'group': 'BlockChain', + 'url': 'webapp/index.php?c=BlockChain&a=getTransactionList', + 'params': [ + ], + 'response': [ + _common.RspHead(), + ] + }, { 'name': 'active721Nft', 'desc': '激活721nft', From 2a741eadfc97505dfd031dc84226e4e2f0c4e21f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 31 Oct 2022 19:21:11 +0800 Subject: [PATCH 3/7] 1 --- doc/BlockChain.py | 1 + doc/_common.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/doc/BlockChain.py b/doc/BlockChain.py index 3738bab8..e9b6e59f 100644 --- a/doc/BlockChain.py +++ b/doc/BlockChain.py @@ -15,6 +15,7 @@ class BlockChain(object): ], 'response': [ _common.RspHead(), + ['!transactions', [_common.NftTransaction()], '交易列表'] ] }, { diff --git a/doc/_common.py b/doc/_common.py index c0dd6025..65ab7c3b 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -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 = [ + ['old_rank', 0, '战斗前段位'], + ['old_score', 0, '战斗前排位分'], + ['new_rank', 0, '战斗后段位'], + ['new_score', 0, '战斗后排位分'], + ] From bd05186dcf0880210ae48ba37cf55285eb8aa9f4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 31 Oct 2022 20:05:15 +0800 Subject: [PATCH 4/7] 1 --- doc/BlockChain.py | 9 +++------ doc/_common.py | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/doc/BlockChain.py b/doc/BlockChain.py index e9b6e59f..8f3e4795 100644 --- a/doc/BlockChain.py +++ b/doc/BlockChain.py @@ -39,8 +39,7 @@ class BlockChain(object): 'group': 'BlockChain', 'url': 'webapp/index.php?c=BlockChain&a=active1155Nft', 'params': [ - ['type', 0, '1:英雄 2:枪械'], - ['uniid', 0, '唯一id'], + ['trans_id', '', '事务id'], ], 'response': [ _common.RspHead(), @@ -97,7 +96,7 @@ class BlockChain(object): 'url': 'webapp/index.php?c=BlockChain&a=evolveChip', 'params': [ ['token_id1', 0, 'tokenid1'], - ['token_id2', 0, 'tokenid2'], + ['token_ids', '', 'tokenids材料id(|分割)'], ], 'response': [ _common.RspHead(), @@ -124,8 +123,7 @@ class BlockChain(object): 'group': 'BlockChain', 'url': 'webapp/index.php?c=BlockChain&a=mintShardBatchUser', 'params': [ - ['token_id1', 0, 'tokenid1'], - ['token_id2', 0, 'tokenid2'], + ['ids', 0, 'tokenid1'], ], 'response': [ _common.RspHead(), @@ -174,5 +172,4 @@ class BlockChain(object): _common.RspHead(), ] }, - ] diff --git a/doc/_common.py b/doc/_common.py index 65ab7c3b..9e2748ea 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -931,8 +931,8 @@ class NftTransaction(object): def __init__(self): self.fields = [ - ['old_rank', 0, '战斗前段位'], - ['old_score', 0, '战斗前排位分'], - ['new_rank', 0, '战斗后段位'], - ['new_score', 0, '战斗后排位分'], + ['item_id', 0, '道具id'], + ['action', 0, '动作'], + ['time', 0, '时间'], + ['status', 0, '1:已完成 2:等待中'], ] From 54a93050ec9591a72cf9a622c7cfad45722d3525 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 31 Oct 2022 20:14:32 +0800 Subject: [PATCH 5/7] 1 --- doc/BlockChain.py | 2 +- .../controller/BlockChainController.class.php | 86 +++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 webapp/controller/BlockChainController.class.php diff --git a/doc/BlockChain.py b/doc/BlockChain.py index 8f3e4795..2bc82646 100644 --- a/doc/BlockChain.py +++ b/doc/BlockChain.py @@ -64,7 +64,7 @@ class BlockChain(object): 'name': 'evolve721Nft', 'desc': 'nft进阶(英雄,武器)', 'group': 'BlockChain', - 'url': 'webapp/index.php?c=BlockChain&a=active1155Nft', + 'url': 'webapp/index.php?c=BlockChain&a=evolve721Nft', 'params': [ ['type', 0, '1:英雄 2:枪械'], ['token_id1', 0, 'tokenid1'], diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php new file mode 100644 index 00000000..c2dcc930 --- /dev/null +++ b/webapp/controller/BlockChainController.class.php @@ -0,0 +1,86 @@ + Date: Mon, 31 Oct 2022 20:27:07 +0800 Subject: [PATCH 6/7] 1 --- sql/gamedb.sql | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 2dcd8e59..8a057616 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -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 */; From f2a48a910dc63272c8c2abbf639986d578605d17 Mon Sep 17 00:00:00 2001 From: lightings <17062401@qq.com> Date: Mon, 31 Oct 2022 20:27:55 +0800 Subject: [PATCH 7/7] update & test shop.py --- doc/Shop.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/Shop.py b/doc/Shop.py index df8e3300..c197434d 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -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'] + ] + } ]