更新
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace app\controller\api;
|
||||
|
||||
use app\model\AiModel;
|
||||
use app\service\SettingsService;
|
||||
|
||||
class Settings extends BaseApi
|
||||
{
|
||||
public function features()
|
||||
{
|
||||
return $this->success(SettingsService::getFeatures());
|
||||
}
|
||||
|
||||
public function publicSettings()
|
||||
{
|
||||
$allow = SettingsService::get('allow_register', true);
|
||||
return $this->success([
|
||||
'site_name' => SettingsService::get('site_name', 'AI Chat'),
|
||||
'allow_register' => $allow === true || $allow === 'true',
|
||||
'features' => SettingsService::getFeatures(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function models()
|
||||
{
|
||||
$list = AiModel::where('enabled', 1)
|
||||
->field('id,name,model_id,is_default')
|
||||
->order('sort_order,id')
|
||||
->select();
|
||||
|
||||
return $this->success($list);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user