From 7d2f2168b0284f94ccaa134418ea7422877d132e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 25 Mar 2022 17:15:36 +0800 Subject: [PATCH] 1 --- doc/BcUser.py | 22 ++++++++++++++++++++++ doc/Wallet.py | 28 +++++++++++++++++++++++----- doc/_common.py | 9 +++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 doc/BcUser.py diff --git a/doc/BcUser.py b/doc/BcUser.py new file mode 100644 index 00000000..84b25ed9 --- /dev/null +++ b/doc/BcUser.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +import _common + +class BcUser(object): + + def __init__(self): + self.apis = [ + { + 'name': 'info', + 'desc': '获取用户信息', + 'group': 'User', + 'url': 'webapp/index.php?c=BcUser&a=login', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ['info',_common.BcUserInfo(), '用户信息'] + ] + }, + ] diff --git a/doc/Wallet.py b/doc/Wallet.py index db169b63..685551a2 100644 --- a/doc/Wallet.py +++ b/doc/Wallet.py @@ -8,30 +8,48 @@ class Wallet(object): self.apis = [ { 'name': 'withdrawal', - 'desc': '提现(game->ERC20)', + 'desc': '提现(game->token)', 'group': 'Wallet', 'url': 'webapp/index.php?c=Wallet&a=withdrawal', 'params': [ ['account', 0, '钱包账号'], ['token', '', 'token'], + ['type', 0, '货币类型 1:金币 2:钻石'], ['amount', '', '金额'], ], 'response': [ _common.RspHead(), + ['seq_id', '', '提现序号(errcode = 0的时候,根据序号客户端定时调用queryWithdrawalResult接口)查询状态'], ] }, { - 'name': 'recharge', - 'desc': '充值(ERC20->game)', + 'name': 'queryWithdrawalResult', + 'desc': '查询提现结果(game->token)', 'group': 'Wallet', - 'url': 'webapp/index.php?c=Wallet&a=recharge', + 'url': 'webapp/index.php?c=Wallet&a=queryWithdrawalResult', 'params': [ ['account', 0, '钱包账号'], ['token', '', 'token'], - ['amount', '', '金额'], + ['seq_id', 0, '提现序号'], + ], + '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值'], ], 'response': [ _common.RspHead(), + ['state', 0, '0:保留 1:保留 2:充值处理中 3:充值失败'], ] }, ] diff --git a/doc/_common.py b/doc/_common.py index dba2bb6e..ef47901e 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -125,6 +125,15 @@ class UserInfo(object): ['!head_frame_list', [0], '拥有的头像框列表'], ] +class BcUserInfo(object): + + def __init__(self): + self.fields = [ + ['account', '', '账号'], + ['gold', 0, '金币'], + ['diamond', 0, '钻石'], + ] + class UserDetailInfo(object): def __init__(self):