163 lines
6.1 KiB
Python
163 lines
6.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
import _common
|
|
|
|
class ComputingPower(object):
|
|
|
|
def __init__(self):
|
|
self.apis = [
|
|
{
|
|
'name': 'info',
|
|
'desc': '获取算力信息',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=info',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['info', _common.ComputingPower(), '算力信息']
|
|
]
|
|
},
|
|
{
|
|
'name': 'getCrystalUi',
|
|
'desc': '获取晶体ui信息',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=getCrystalUi',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['data', _common.CrystalUI(), '晶体的获取方式信息']
|
|
]
|
|
},
|
|
{
|
|
'name': 'exchangeCrystal',
|
|
'desc': '兑换晶体',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=exchangeCrystal',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['item_id', 0, '晶体item'],
|
|
# ['item_num', 0, '晶体数量'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
]
|
|
},
|
|
{
|
|
'name': 'getExchangeCrystalRecord',
|
|
'desc': '获取兑换晶体记录',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=getExchangeCrystalRecord',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['data', _common.ExchangeCrystalRecord(), '算力信息']
|
|
]
|
|
},
|
|
{
|
|
'name': 'exchangePower',
|
|
'desc': '晶体兑换算力',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=exchangePower',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['num1', 0, '晶体260001兑换数'],
|
|
['num2', 0, '晶体260002兑换数'],
|
|
['num3', 0, '晶体260003兑换数'],
|
|
['num4', 0, '晶体260004兑换数'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
]
|
|
},
|
|
{
|
|
'name': 'exchangeUplimit',
|
|
'desc': '每周晶体兑换上限',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=exchangeUplimit',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['data', _common.ExchangeCrystalNum(), '本周期晶体兑换信息']
|
|
]
|
|
},
|
|
{
|
|
'name': 'getRewardHistory',
|
|
'desc': '获取奖励历史',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=getRewardHistory',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['star_time', 0, '开始时间,都没传查全部'],
|
|
['end_time', 0, '结束时间,都没传查全部'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['!data', [_common.CECRewardHistory()], '算力信息'],
|
|
['pending_rewards', '', '剩余总计'],
|
|
]
|
|
},
|
|
{
|
|
'name': 'exchangeCrystalInfo',
|
|
'desc': '晶体兑换信息',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=exchangeCrystalInfo',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['totalNum', 0, '可领取的总晶体'],
|
|
['!playing', [Info()], '游戏行为'],
|
|
['!staking', [Info()], '质押行为'],
|
|
['!consuming', [Info()], '支出行为'],
|
|
]
|
|
},
|
|
{
|
|
'name': 'claimCrystal',
|
|
'desc': '一键领取晶体',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=claimCrystal',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['award', _common.Award(), '奖励信息'],
|
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
]
|
|
},
|
|
{
|
|
'name': 'exchangePowerNew',
|
|
'desc': '晶体兑换算力',
|
|
'group': 'ComputingPower',
|
|
'url': 'webapp/index.php?c=ComputingPower&a=exchangePowerNew',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['num', 0, '晶体兑换数'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
]
|
|
},
|
|
]
|
|
|
|
|
|
class Info(object):
|
|
|
|
def __init__(self):
|
|
self.fields = [
|
|
['task_id', 0, 'task_id'],
|
|
['uplimit', '', '上限数量 -1为无上限'],
|
|
['chaim_num', 0, '可领取数量'],
|
|
] |