From 10a95dff2ef212431460a07bbe915ab894154957 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 4 Aug 2023 17:06:04 +0800 Subject: [PATCH] 1 --- doc/Wallet.py | 58 --------- webapp/controller/WalletController.class.php | 121 ------------------- 2 files changed, 179 deletions(-) delete mode 100644 doc/Wallet.py delete mode 100644 webapp/controller/WalletController.class.php diff --git a/doc/Wallet.py b/doc/Wallet.py deleted file mode 100644 index da3c1cad..00000000 --- a/doc/Wallet.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -import _common - -class Wallet(object): - - def __init__(self): - self.apis = [ - { - 'name': 'withdrawal', - 'desc': '提现(game->token)', - 'group': 'Wallet', - 'url': 'webapp/index.php?c=Wallet&a=withdrawal', - 'params': [ - ['account', 0, '钱包账号'], - ['token', '', 'token'], - ['type', 0, '货币类型 1:金币 2:钻石'], - ['amount', '', '金额'], - ['net_id', '', '网络id'], - ], - 'response': [ - _common.RspHead(), - ['seq_id', '', '提现序号(errcode = 0的时候,根据序号客户端定时调用queryWithdrawalResult接口)查询状态'], - ] - }, - { - 'name': 'queryWithdrawalResult', - 'desc': '查询提现结果(game->token)', - 'group': 'Wallet', - 'url': 'webapp/index.php?c=Wallet&a=queryWithdrawalResult', - 'params': [ - ['account', 0, '钱包账号'], - ['token', '', 'token'], - ['seq_id', 0, '提现序号'], - ['net_id', '', '网络id'], - ], - 'response': [ - _common.RspHead(errcode='当errcode!=0的时候客户端不需要再调用(停止定时器)'), - ['state', 0, '0:提现序号不存在 1:提现成功 2:提现处理中 3:提现失败'], - ] - }, - { - 'name': 'queryRechargeResult', - 'desc': '查询充值结果(token->game)', - 'group': 'Wallet', - 'url': 'webapp/index.php?c=Wallet&a=queryRechargeResult', - 'params': [ - ['account', 0, '钱包账号'], - ['token', '', 'token'], - ['txhash', 0, 'hash值'], - ['net_id', '', '网络id'], - ], - 'response': [ - _common.RspHead(), - ['state', 0, '0:保留 1:充值成功 2:充值处理中 3:充值失败'], - ] - }, - ] diff --git a/webapp/controller/WalletController.class.php b/webapp/controller/WalletController.class.php deleted file mode 100644 index 5e7ac513..00000000 --- a/webapp/controller/WalletController.class.php +++ /dev/null @@ -1,121 +0,0 @@ -_rspErr(2, 'parameter error'); - return; - $account = strtolower(getReqVal('account', '')); - $token = getReqVal('token', ''); - $type = getReqVal('type', ''); - $netId = getReqVal('net_id', ''); - $amount = getReqVal('amount', ''); - $times = Withdrawal::getTodayWithdrawalTimes($account); - if ($times > 200) { - myself()->_rspErr(1, 'More withdrawals than today'); - return; - } - if (!in_array($type, array(1, 2))){ - myself()->_rspErr(2, 'parameter error'); - return; - } - if (strlen($amount) <= 18){ - myself()->_rspErr(4, 'parameter error'); - return; - } - $value = substr($amount, 0, -18); - if ($value < 0 || empty($value)) { - myself()->_rspErr(4, 'parameter error'); - return; - } - $seqId = Withdrawal::add($account, $type, $netId, $amount); - myself()->_rspData(array( - 'seq_id' => $seqId - )); - } - - public function queryWithdrawalResult() - { - $account = strtolower(getReqVal('account', '')); - $seqId = getReqVal('seq_id', ''); - $row = Withdrawal::find($seqId); - if (!$row || $row['account'] != $account) { - myself()->_rspErr(0, 'not found'); - return; - } - if ($row['state'] == 1) { - myself()->_rspData(array( - 'state' => 2 - )); - return; - } - if ($row['state'] == 3) { - myself()->_rspData(array( - 'state' => 3 - )); - return; - } - $transferDb = Transfer::find($row['bc_txhash']); - if (!$transferDb) { - myself()->_rspData(array( - 'state' => 2 - )); - return; - } - if ($transferDb['state'] == 0) { - myself()->_rspData(array( - 'state' => 2 - )); - return; - } else { - myself()->_rspData(array( - 'state' => 1 - )); - return; - } - } - - public function queryRechargeResult() - { - myself()->_rspErr(2, 'parameter error'); - return; - $account = strtolower(getReqVal('account', '')); - $txHash = getReqVal('txhash', ''); - $transferDb = Transfer::find($txHash); - if (!$transferDb) { - myself()->_rspData(array( - 'state' => 2 - )); - return; - } - if ($transferDb['state'] == 0) { - myself()->_rspData(array( - 'state' => 2 - )); - return; - } else { - myself()->_rspData(array( - 'state' => 1 - )); - return; - } - } - -}