1
This commit is contained in:
parent
d67479e07b
commit
896db8037a
19
doc/OutAppTools.py
Normal file
19
doc/OutAppTools.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import _common
|
||||||
|
|
||||||
|
class OutAppTools(object):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.apis = [
|
||||||
|
{
|
||||||
|
'name': 'refreshServerSwitch',
|
||||||
|
'desc': '刷新服务器开关配置',
|
||||||
|
'group': 'OutAppTools',
|
||||||
|
'url': 'webapp/index.php?c=OutAppTools&a=refreshServerSwitch',
|
||||||
|
'params': [
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
16
webapp/controller/OutAppToolsController.class.php
Normal file
16
webapp/controller/OutAppToolsController.class.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
use phpcommon\SqlHelper;
|
||||||
|
|
||||||
|
require_once('services/ServerSwitchService.php');
|
||||||
|
|
||||||
|
use services\ServerSwitchService;
|
||||||
|
class OutAppToolsController extends BaseController {
|
||||||
|
public function refreshServerSwitch(){
|
||||||
|
$redis = myself()->_getRedis(ServerSwitchService::SERVER_SWITCH_KEY);
|
||||||
|
$data = ServerSwitchService::selectSwitchTable();
|
||||||
|
$redis->set(ServerSwitchService::SERVER_SWITCH_KEY,json_encode($data));
|
||||||
|
$redis->pexpire(ServerSwitchService::SERVER_SWITCH_KEY , 10*1000);
|
||||||
|
$this->_rspOk();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -73,7 +73,7 @@ class ServerSwitchService {
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function selectSwitchTable(){
|
public static function selectSwitchTable(){
|
||||||
$rows = SqlHelper::ormSelect(myself()->_getConfDbMysql(), 't_game_switch', array());
|
$rows = SqlHelper::ormSelect(myself()->_getConfDbMysql(), 't_game_switch', array());
|
||||||
$data = array(
|
$data = array(
|
||||||
'normal' => array(),
|
'normal' => array(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user