This commit is contained in:
hujiabin 2024-08-29 17:02:50 +08:00
parent d67479e07b
commit 896db8037a
3 changed files with 36 additions and 1 deletions

19
doc/OutAppTools.py Normal file
View 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(),
]
},
]

View 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();
}
}

View File

@ -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(),