diff --git a/doc/Bigwheel.py b/doc/Bigwheel.py new file mode 100644 index 00000000..f94dbfc7 --- /dev/null +++ b/doc/Bigwheel.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +import _common + +class Bigwheel(object): + + def __init__(self): + self.apis = [ + { + 'name': 'info', + 'desc': '转盘信息', + 'group': 'Bigwheel', + 'url': 'webapp/index.php?c=Bigwheel&a=info', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ['info', _common.BigwheelInfo(), '转盘信息'], + ] + }, + { + 'name': 'drawS', + 'desc': '抽奖', + 'group': 'Bigwheel', + 'url': 'webapp/index.php?c=Bigwheel&a=drawS', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ['award', _common.Award(), '奖励信息'], + ['property_chg', _common.PropertyChg(), '属性变更'], + ['info', _common.BigwheelInfo(), '转盘信息'], + ] + }, + { + 'name': 'buyS', + 'desc': '购买', + 'group': 'Bigwheel', + 'url': 'webapp/index.php?c=Bigwheel&a=buyS', + 'params': [ + _common.ReqHead(), + ['grid_id', 0, '格子id'] + ], + 'response': [ + _common.RspHead(), + ['award', _common.Award(), '奖励信息'], + ['property_chg', _common.PropertyChg(), '属性变更'], + ['info', _common.BigwheelInfo(), '转盘信息'], + ] + } + ] diff --git a/doc/_common.py b/doc/_common.py index c40164f6..69996831 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -1845,3 +1845,26 @@ class RechargeHistory(object): ['amount', '', '货币数'], ['createtime', 0, '成交时间'], ] + +class BigwheelGrid(object): + + def __init__(self): + self.fields = [ + ['grid_id', 0, '格子id(Bigwheel表里的id字段)'], + ['grid_state', 0, '0:未抽 1:已抽到且商品属于你 2:已抽到且商品还未属于你(需要购买)'], + ['item_id', 0, '道具id(state>0时有效)'], + ['item_num', 0, '道具数量(state>0时有效)'], + ['buy_price', 0, '购买价格(state=2时有效)'], + ] + +class BigwheelInfo(object): + + def __init__(self): + self.fields = [ + ['drawed_times', 0, '已抽次数'], + ['total_times', 0, '总次数'], + ['single_cost', 0, '单次抽奖消耗(钻石)'], + ['double_cost', 0, '双次抽奖消耗(钻石)'], + ['!items1', [BigwheelGrid()], '档位1'], + ['!items2', [BigwheelGrid()], '档位2'], + ] diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php new file mode 100644 index 00000000..9bb009b9 --- /dev/null +++ b/webapp/controller/BigwheelController.class.php @@ -0,0 +1,29 @@ +