66 lines
1.6 KiB
PHP
66 lines
1.6 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Controller\AbstractController;
|
|
use App\Middleware\Admin\JwtAuthMiddleware;
|
|
use App\Service\Admin\System\ConfigService;
|
|
use App\Service\Admin\System\SystemService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middlewares;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use RedisException;
|
|
|
|
#[Controller(prefix: "admin/config")]
|
|
#[Middlewares([
|
|
JwtAuthMiddleware::class,
|
|
])]
|
|
class ConfigController extends AbstractController
|
|
{
|
|
/**
|
|
* 获取配置模块
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "module", methods: "GET")]
|
|
public function getConfigModule()
|
|
{
|
|
return (new ConfigService)->getConfigModule();
|
|
}
|
|
|
|
/**
|
|
* 获取配置数据
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "form", methods: "GET")]
|
|
public function getConfigForm()
|
|
{
|
|
return (new ConfigService)->getConfigForm();
|
|
}
|
|
|
|
/**
|
|
* 修改配置
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "update", methods: "POST")]
|
|
public function updateConfig()
|
|
{
|
|
return (new ConfigService)->handle();
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
* @throws RedisException
|
|
*/
|
|
#[RequestMapping(path: "system/address_list", methods: "GET")]
|
|
public function getAddressList()
|
|
{
|
|
return (new SystemService)->address_list();
|
|
}
|
|
}
|