103 lines
3.7 KiB
Python
103 lines
3.7 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
import _common
|
|
|
|
class Chip(object):
|
|
|
|
def __init__(self):
|
|
self.apis = [
|
|
{
|
|
'name': 'chipList',
|
|
'desc': '获取芯片列表',
|
|
'group': 'Chip',
|
|
'url': 'webapp/index.php?c=Chip&a=chipList',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['!data', [_common.Chip()], '芯片列表']
|
|
]
|
|
},{
|
|
'name': 'chipDetails',
|
|
'desc': '芯片详情',
|
|
'group': 'Chip',
|
|
'url': 'webapp/index.php?c=Chip&a=chipDetails',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['unique_id', '', 'unique_id'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['!data', [_common.Chip()], '芯片信息']
|
|
]
|
|
},{
|
|
'name': 'upgradeAttrChange',
|
|
'desc': '芯片升级属性变化',
|
|
'group': 'Chip',
|
|
'url': 'webapp/index.php?c=Chip&a=upgradeAttrChange',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['chip_uniid', '', '芯片唯一id'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['!data', [AttrChange()], '属性变化信息']
|
|
]
|
|
},{
|
|
'name': 'upgradeQualityS',
|
|
'desc': '芯片升阶',
|
|
'group': 'Chip',
|
|
'surl': 'webapp/index.php?c=Chip&a=upgradeQualityS',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['chip_uniid', '', '升阶芯片唯一id'],
|
|
['consume_uniids', '', '材料芯片唯一id,用“|”隔开'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['status', 0, '0=失败 1=成功'],
|
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
]
|
|
},
|
|
{
|
|
'name': 'synChipS',
|
|
'desc': '芯片合成',
|
|
'group': 'Chip',
|
|
'surl': 'webapp/index.php?c=Chip&a=synChipS',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['item_id', '', '材料item_id'],
|
|
['item_num', '', '材料item_num'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['award', _common.AwardItem(), '合成芯片奖励'],
|
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
]
|
|
},
|
|
{
|
|
'name': 'resolveChip',
|
|
'desc': '分解芯片',
|
|
'group': 'Chip',
|
|
'url': 'webapp/index.php?c=Chip&a=resolveChip',
|
|
'params': [
|
|
_common.ReqHead(),
|
|
['chip_uniids', '', '芯片uniid 多个用“|”隔开'],
|
|
],
|
|
'response': [
|
|
_common.RspHead(),
|
|
['award', _common.AwardItem(), '分解所得材料'],
|
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
]
|
|
},
|
|
]
|
|
|
|
class AttrChange(object):
|
|
|
|
def __init__(self):
|
|
self.fields = [
|
|
['attr_id', 0, '属性id'],
|
|
['min_val', 0, '最小属性值'],
|
|
['max_val', 0, '最大属性值'],
|
|
] |