feat : city

This commit is contained in:
2024-10-31 16:52:32 +08:00
parent ceeeea7c34
commit 2d8f35ddf0
5 changed files with 100 additions and 3 deletions

View File

@@ -5,22 +5,50 @@ 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\System\SystemService;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\Middlewares;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\Validation\Annotation\Scene;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use RedisException;
#[Controller(prefix: "admin/config")]
#[Middlewares([
JwtAuthMiddleware::class,
])]
class ConfigController extends AbstractController
{
#[RequestMapping(path: "module", methods: "GET")]
public function getConfigModule()
{
return (new ConfigService)->getConfigModule();
}
#[RequestMapping(path: "form", methods: "GET")]
public function getConfigForm()
{
return (new ConfigService)->getConfigForm();
}
#[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();
}
}