并发处理
This commit is contained in:
parent
68ad3df9f5
commit
79acc95aa9
@ -45,10 +45,10 @@ class Avatar(object):
|
|||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'buyAvatar',
|
'name': 'buyAvatarS',
|
||||||
'desc': '购买装饰物品',
|
'desc': '购买装饰物品',
|
||||||
'group': 'Avatar',
|
'group': 'Avatar',
|
||||||
'url': 'webapp/index.php?c=Avatar&a=buyAvatar',
|
'surl': 'webapp/index.php?c=Avatar&a=buyAvatarS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['item_id', '', '装饰物品itemId'],
|
['item_id', '', '装饰物品itemId'],
|
||||||
|
@ -54,10 +54,10 @@ class Bag(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'buyItem',
|
'name': 'buyItemS',
|
||||||
'desc': '购买道具(目前只一次购买改名卡)',
|
'desc': '购买道具(目前只一次购买改名卡)',
|
||||||
'group': 'Bag',
|
'group': 'Bag',
|
||||||
'url': 'webapp/index.php?c=Bag&a=buyItem',
|
'surl': 'webapp/index.php?c=Bag&a=buyItemS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['item_id', '', '道具id'],
|
['item_id', '', '道具id'],
|
||||||
|
@ -45,10 +45,10 @@ class Chip(object):
|
|||||||
['!data', [AttrChange()], '属性变化信息']
|
['!data', [AttrChange()], '属性变化信息']
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'upgradeQuality',
|
'name': 'upgradeQualityS',
|
||||||
'desc': '芯片升阶',
|
'desc': '芯片升阶',
|
||||||
'group': 'Chip',
|
'group': 'Chip',
|
||||||
'url': 'webapp/index.php?c=Chip&a=upgradeQuality',
|
'surl': 'webapp/index.php?c=Chip&a=upgradeQualityS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['chip_uniid', '', '升阶芯片唯一id'],
|
['chip_uniid', '', '升阶芯片唯一id'],
|
||||||
@ -61,10 +61,10 @@ class Chip(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'synChip',
|
'name': 'synChipS',
|
||||||
'desc': '芯片合成',
|
'desc': '芯片合成',
|
||||||
'group': 'Chip',
|
'group': 'Chip',
|
||||||
'url': 'webapp/index.php?c=Chip&a=synChip',
|
'surl': 'webapp/index.php?c=Chip&a=synChipS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['item_id', '', '材料item_id'],
|
['item_id', '', '材料item_id'],
|
||||||
|
@ -25,10 +25,10 @@ class HashRate(object):
|
|||||||
['refresh_times', 0, '今日刷新次数'],
|
['refresh_times', 0, '今日刷新次数'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'commitTask',
|
'name': 'commitTaskS',
|
||||||
'desc': '获取算力信息',
|
'desc': '获取算力信息',
|
||||||
'group': 'HashRate',
|
'group': 'HashRate',
|
||||||
'url': 'webapp/index.php?c=HashRate&a=commitTask',
|
'surl': 'webapp/index.php?c=HashRate&a=commitTaskS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['task_id', 0, '任务id'],
|
['task_id', 0, '任务id'],
|
||||||
|
@ -75,10 +75,10 @@ class Hero(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'upgradeQuality',
|
'name': 'upgradeQualityS',
|
||||||
'desc': '英雄升阶',
|
'desc': '英雄升阶',
|
||||||
'group': 'Hero',
|
'group': 'Hero',
|
||||||
'url': 'webapp/index.php?c=Hero&a=upgradeQuality',
|
'surl': 'webapp/index.php?c=Hero&a=upgradeQualityS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['hero_uniid', 0, '英雄唯一id'],
|
['hero_uniid', 0, '英雄唯一id'],
|
||||||
@ -107,10 +107,10 @@ class Hero(object):
|
|||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'synHero',
|
'name': 'synHeroS',
|
||||||
'desc': '英雄合成',
|
'desc': '英雄合成',
|
||||||
'group': 'Hero',
|
'group': 'Hero',
|
||||||
'url': 'webapp/index.php?c=Hero&a=synHero',
|
'surl': 'webapp/index.php?c=Hero&a=synHeroS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['item_id', 0, '碎片item_id'],
|
['item_id', 0, '碎片item_id'],
|
||||||
|
@ -70,10 +70,10 @@ class HeroSkin(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'synSkin',
|
'name': 'synSkinS',
|
||||||
'desc': '皮肤合成',
|
'desc': '皮肤合成',
|
||||||
'group': 'HeroSkin',
|
'group': 'HeroSkin',
|
||||||
'url': 'webapp/index.php?c=HeroSkin&a=synSkin',
|
'surl': 'webapp/index.php?c=HeroSkin&a=synSkinS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['item_id', 0, '材料itemId'],
|
['item_id', 0, '材料itemId'],
|
||||||
|
@ -29,10 +29,10 @@ class InGameMall(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'sell',
|
'name': 'sellS',
|
||||||
'desc': '出售',
|
'desc': '出售',
|
||||||
'group': 'InGameMall',
|
'group': 'InGameMall',
|
||||||
'url': 'webapp/index.php?c=InGameMall&a=sell',
|
'surl': 'webapp/index.php?c=InGameMall&a=sellS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['goods_uniid', '', '道具id'],
|
['goods_uniid', '', '道具id'],
|
||||||
@ -45,10 +45,10 @@ class InGameMall(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'buy',
|
'name': 'buyS',
|
||||||
'desc': '购买',
|
'desc': '购买',
|
||||||
'group': 'InGameMall',
|
'group': 'InGameMall',
|
||||||
'url': 'webapp/index.php?c=InGameMall&a=buy',
|
'surl': 'webapp/index.php?c=InGameMall&a=buyS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['order_id', '', '订单id'],
|
['order_id', '', '订单id'],
|
||||||
@ -59,10 +59,10 @@ class InGameMall(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'cancel',
|
'name': 'cancelS',
|
||||||
'desc': '下架物品',
|
'desc': '下架物品',
|
||||||
'group': 'InGameMall',
|
'group': 'InGameMall',
|
||||||
'url': 'webapp/index.php?c=InGameMall&a=cancel',
|
'surl': 'webapp/index.php?c=InGameMall&a=cancelS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['order_id', '', '订单id'],
|
['order_id', '', '订单id'],
|
||||||
@ -135,10 +135,10 @@ class InGameMall(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'shoppingCartBuy',
|
'name': 'shoppingCartBuyS',
|
||||||
'desc': '购物车下单',
|
'desc': '购物车下单',
|
||||||
'group': 'InGameMall',
|
'group': 'InGameMall',
|
||||||
'url': 'webapp/index.php?c=InGameMall&a=shoppingCartBuy',
|
'surl': 'webapp/index.php?c=InGameMall&a=shoppingCartBuyS',
|
||||||
'params':[
|
'params':[
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['order_ids', '', '订单id(多个订单用 | 隔开)'],
|
['order_ids', '', '订单id(多个订单用 | 隔开)'],
|
||||||
|
@ -18,6 +18,20 @@
|
|||||||
* @apiSuccessExample {json} Success-Response:
|
* @apiSuccessExample {json} Success-Response:
|
||||||
* 2024/07/25
|
* 2024/07/25
|
||||||
* c=Bag&a=useItemS
|
* c=Bag&a=useItemS
|
||||||
|
* c=Bag&a=buyItemS
|
||||||
|
* c=Avatar&a=buyAvatarS
|
||||||
|
* c=Chip&a=upgradeQualityS
|
||||||
|
* c=Chip&a=synChipS
|
||||||
|
* c=HashRate&a=commitTaskS
|
||||||
|
* c=Hero&a=synHeroS
|
||||||
|
* c=Hero&a=upgradeQualityS
|
||||||
|
* c=HeroSkin&a=synSkinS
|
||||||
|
* c=InGameMall&a=sellS
|
||||||
|
* c=InGameMall&a=buyS
|
||||||
|
* c=InGameMall&a=cancelS
|
||||||
|
* c=InGameMall&a=shoppingCartBuyS
|
||||||
|
* c=Sign&a=receiveS
|
||||||
|
* c=User&a=selectFreeItemS
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -20,10 +20,10 @@ class Sign(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'receive',
|
'name': 'receiveS',
|
||||||
'desc': '领取签到奖励',
|
'desc': '领取签到奖励',
|
||||||
'group': 'Sign',
|
'group': 'Sign',
|
||||||
'url': 'webapp/index.php?c=Sign&a=receive',
|
'surl': 'webapp/index.php?c=Sign&a=receiveS',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['sign_id', '', '签到id'],
|
['sign_id', '', '签到id'],
|
||||||
|
13
doc/User.py
13
doc/User.py
@ -150,6 +150,19 @@ class User(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!data', [], '列表'],
|
['!data', [], '列表'],
|
||||||
]
|
]
|
||||||
|
},{
|
||||||
|
'name': 'selectFreeItemS',
|
||||||
|
'desc': '获取免费英雄和武器列表',
|
||||||
|
'group': 'User',
|
||||||
|
'surl': 'webapp/index.php?c=User&a=selectFreeItemS',
|
||||||
|
'params': [
|
||||||
|
_common.ReqHead(),
|
||||||
|
['itemId', 0, '英雄itemId'],
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
['!data', [], 'item'],
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'method': 'POST',
|
'method': 'POST',
|
||||||
|
@ -128,7 +128,7 @@ class AvatarController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function buyAvatar(){
|
public function buyAvatarS(){
|
||||||
$itemId = trim(getReqVal('item_id', 0));
|
$itemId = trim(getReqVal('item_id', 0));
|
||||||
$itemMeta = \mt\Item::get($itemId);
|
$itemMeta = \mt\Item::get($itemId);
|
||||||
if (!$itemMeta || $itemMeta['type'] != \mt\Item::AVATAR_TYPE){
|
if (!$itemMeta || $itemMeta['type'] != \mt\Item::AVATAR_TYPE){
|
||||||
|
@ -466,7 +466,7 @@ class BagController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function buyItem()
|
public function buyItemS()
|
||||||
{
|
{
|
||||||
$itemId = getReqVal('item_id', 0);
|
$itemId = getReqVal('item_id', 0);
|
||||||
$itemNum = getReqVal('item_num', 1);
|
$itemNum = getReqVal('item_num', 1);
|
||||||
|
@ -476,6 +476,7 @@ class BaseAuthedController extends BaseController {
|
|||||||
|
|
||||||
public function _addItems($items, $awardService, $propertyService)
|
public function _addItems($items, $awardService, $propertyService)
|
||||||
{
|
{
|
||||||
|
myself()->_checkS();
|
||||||
$heads = array();
|
$heads = array();
|
||||||
$headFrames = array();
|
$headFrames = array();
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
@ -630,6 +631,7 @@ class BaseAuthedController extends BaseController {
|
|||||||
|
|
||||||
public function _decItems($items)
|
public function _decItems($items)
|
||||||
{
|
{
|
||||||
|
myself()->_checkS();
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
//道具消耗埋点
|
//道具消耗埋点
|
||||||
LogService::consumeItem($item);
|
LogService::consumeItem($item);
|
||||||
|
@ -370,4 +370,11 @@ class BaseController {
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function _checkS()
|
||||||
|
{
|
||||||
|
$sign = getReqVal('__sign', '');
|
||||||
|
if (empty($sign)) {
|
||||||
|
error_log('waring unsafe call---------------' . json_encode($_REQUEST));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ class ChipController extends BaseAuthedController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function upgradeQuality(){
|
public function upgradeQualityS(){
|
||||||
$chipUniId = getReqVal('chip_uniid', 0);
|
$chipUniId = getReqVal('chip_uniid', 0);
|
||||||
$consumeUniIds = getReqVal('consume_uniids',0);
|
$consumeUniIds = getReqVal('consume_uniids',0);
|
||||||
$chipDb = Chip::find($chipUniId);
|
$chipDb = Chip::find($chipUniId);
|
||||||
@ -212,7 +212,7 @@ class ChipController extends BaseAuthedController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function synChip(){
|
public function synChipS(){
|
||||||
$itemId = getReqVal('item_id',0);
|
$itemId = getReqVal('item_id',0);
|
||||||
$itemNum = getReqVal('item_num',0);
|
$itemNum = getReqVal('item_num',0);
|
||||||
$needItem = \mt\Parameter::getVal('chip_craft_need_item',0);
|
$needItem = \mt\Parameter::getVal('chip_craft_need_item',0);
|
||||||
|
@ -67,7 +67,7 @@ class HashRateController extends BaseAuthedController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function commitTask(){
|
public function commitTaskS(){
|
||||||
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
|
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
|
||||||
if (! $currentPeriod){
|
if (! $currentPeriod){
|
||||||
$this->_rspErr(1, 'Already ended');
|
$this->_rspErr(1, 'Already ended');
|
||||||
|
@ -73,7 +73,7 @@ class HeroController extends BaseAuthedController {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function synHero(){
|
public function synHeroS(){
|
||||||
$itemId = getReqVal('item_id',0);
|
$itemId = getReqVal('item_id',0);
|
||||||
$itemNum = getReqVal('item_num',0);
|
$itemNum = getReqVal('item_num',0);
|
||||||
$itemMeta = \mt\Item::get($itemId);
|
$itemMeta = \mt\Item::get($itemId);
|
||||||
@ -129,7 +129,7 @@ class HeroController extends BaseAuthedController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function upgradeQuality(){
|
public function upgradeQualityS(){
|
||||||
$heroUniId = getReqVal('hero_uniid', 0);
|
$heroUniId = getReqVal('hero_uniid', 0);
|
||||||
$itemId = getReqVal('item_id',0);
|
$itemId = getReqVal('item_id',0);
|
||||||
$itemNum = max(0,getReqVal('item_num',0));
|
$itemNum = max(0,getReqVal('item_num',0));
|
||||||
|
@ -166,7 +166,7 @@ class HeroSkinController extends BaseAuthedController {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function synSkin(){
|
public function synSkinS(){
|
||||||
$itemId = getReqVal('item_id',0);
|
$itemId = getReqVal('item_id',0);
|
||||||
$itemNum = getReqVal('item_num',0);
|
$itemNum = getReqVal('item_num',0);
|
||||||
$itemMeta = \mt\Item::get($itemId);
|
$itemMeta = \mt\Item::get($itemId);
|
||||||
|
@ -185,7 +185,7 @@ class InGameMallController extends BaseAuthedController {
|
|||||||
myself()->_rspData($out);
|
myself()->_rspData($out);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sell()
|
public function sellS()
|
||||||
{
|
{
|
||||||
$goodsUniid = getReqVal('goods_uniid', '');
|
$goodsUniid = getReqVal('goods_uniid', '');
|
||||||
$itemId = getReqVal('item_id', '');
|
$itemId = getReqVal('item_id', '');
|
||||||
@ -294,7 +294,7 @@ class InGameMallController extends BaseAuthedController {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buy(){
|
public function buyS(){
|
||||||
$orderId = getReqVal('order_id', '');
|
$orderId = getReqVal('order_id', '');
|
||||||
$goodsDb = InGameMall::findByOrderId($orderId);
|
$goodsDb = InGameMall::findByOrderId($orderId);
|
||||||
if (!$goodsDb) {
|
if (!$goodsDb) {
|
||||||
@ -431,7 +431,7 @@ EOD;
|
|||||||
LogService::burialPointEvent($event1);
|
LogService::burialPointEvent($event1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancel()
|
public function cancelS()
|
||||||
{
|
{
|
||||||
$orderId = getReqVal('order_id', '');
|
$orderId = getReqVal('order_id', '');
|
||||||
$goodsDb = InGameMall::findByOrderId($orderId);
|
$goodsDb = InGameMall::findByOrderId($orderId);
|
||||||
@ -642,7 +642,7 @@ EOD;
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shoppingCartBuy(){
|
public function shoppingCartBuyS(){
|
||||||
$orderIds = getReqVal('order_ids', '');
|
$orderIds = getReqVal('order_ids', '');
|
||||||
if (!$orderIds){
|
if (!$orderIds){
|
||||||
$this->_rspErr(1, 'param is not null');
|
$this->_rspErr(1, 'param is not null');
|
||||||
|
@ -51,7 +51,7 @@ class SignController extends BaseAuthedController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function receive(){
|
public function receiveS(){
|
||||||
$sign_id = getReqVal('sign_id', '');
|
$sign_id = getReqVal('sign_id', '');
|
||||||
$meta = \mt\Sign::get($sign_id);
|
$meta = \mt\Sign::get($sign_id);
|
||||||
if (!$meta){
|
if (!$meta){
|
||||||
|
@ -21,9 +21,12 @@ class StarController extends BaseAuthedController {
|
|||||||
private $currMissionSeasonMeta = null;
|
private $currMissionSeasonMeta = null;
|
||||||
public function _handlePre()
|
public function _handlePre()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(getReqVal('a', '') != 'resetStar'){
|
if(getReqVal('a', '') != 'resetStar'){
|
||||||
parent::_handlePre();
|
parent::_handlePre();
|
||||||
}
|
}
|
||||||
|
$this->_rspErr(10, 'server internal error');
|
||||||
|
die();
|
||||||
$this->currMissionSeasonMeta = \mt\StarLevel::getCurrentSeason();
|
$this->currMissionSeasonMeta = \mt\StarLevel::getCurrentSeason();
|
||||||
if (!$this->currMissionSeasonMeta) {
|
if (!$this->currMissionSeasonMeta) {
|
||||||
$this->_rspErr(10, 'server internal error');
|
$this->_rspErr(10, 'server internal error');
|
||||||
|
@ -912,7 +912,7 @@ class UserController extends BaseAuthedController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function selectFreeItem(){
|
public function selectFreeItemS(){
|
||||||
$itemId = getReqVal('itemId', '');
|
$itemId = getReqVal('itemId', '');
|
||||||
if (!$itemId){
|
if (!$itemId){
|
||||||
$this->_rspErr(1, 'param is error');
|
$this->_rspErr(1, 'param is error');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user