增加获取配置接口

This commit is contained in:
yangduo 2025-02-19 14:37:40 +08:00
parent 516dd7be52
commit 108c115996

View File

@ -0,0 +1,48 @@
<?php
require_once 'metatable/shopGoods.php';
require_once 'metatable/privilegecard.php';
require_once 'metatable/rechargeActivity.php';
require_once 'metatable/item.php';
class VoiceController
{
public function get()
{
$account_id = $_REQUEST['account_id'];
//登录校验
$login = loginVerify($account_id, $_REQUEST['session_id']);
if (!$login) {
phpcommon\sendError(ERR_USER_BASE + 1, 'session无效');
return;
}
$type = $_REQUEST['type'];
$conf = array();
switch ($type) {
case 1:
$conf = metatable\getRechargeActivityConf();
break;
case 2:
$conf = metatable\getPrivilegeCardConf();
break;
case 3:
$conf = metatable\getShopGoodsConf();
break;
case 4:
$conf = metatable\getItemConf();
break;
default:
phpcommon\sendError(ERR_USER_BASE + 1, '参数无效');
return;
}
echo json_encode(array(
'errcode' => 0,
'errmsg' => '',
'type' => $type,
'conf' => $conf,
));
}
}