diff --git a/doc/OutAppTools.py b/doc/OutAppTools.py new file mode 100644 index 00000000..7b5ca6cc --- /dev/null +++ b/doc/OutAppTools.py @@ -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(), + ] + }, + + ] \ No newline at end of file diff --git a/webapp/controller/OutAppToolsController.class.php b/webapp/controller/OutAppToolsController.class.php new file mode 100644 index 00000000..4def3b49 --- /dev/null +++ b/webapp/controller/OutAppToolsController.class.php @@ -0,0 +1,16 @@ +_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(); + } + +} diff --git a/webapp/services/ServerSwitchService.php b/webapp/services/ServerSwitchService.php index 504307ed..c47a9672 100644 --- a/webapp/services/ServerSwitchService.php +++ b/webapp/services/ServerSwitchService.php @@ -73,7 +73,7 @@ class ServerSwitchService { return $data; } - private static function selectSwitchTable(){ + public static function selectSwitchTable(){ $rows = SqlHelper::ormSelect(myself()->_getConfDbMysql(), 't_game_switch', array()); $data = array( 'normal' => array(),