Files
hyperf_service/app/Controller/Api/SystemController.php
2025-03-31 16:22:44 +08:00

76 lines
2.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Controller\Api;
use App\Controller\AbstractController;
use App\Middleware\Api\JwtAuthMiddleware;
use App\Service\Api\IndexService;
use App\Service\Api\System\AliStsService;
use App\Service\Api\System\CityListService;
use App\Service\Api\System\MiniWxConfigService;
use App\Service\Api\System\SiteListService;
use App\Service\Api\System\SystemConfigService;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\HttpServer\Annotation\Middlewares;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\Validation\Annotation\Scene;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
#[Controller(prefix: 'api/system')]
class SystemController extends AbstractController
{
#[RequestMapping(path: 'site/search_list',methods: 'POST')]
#[Scene(scene: 'search_list')]
public function searchSiteList()
{
return (new SiteListService)->handle();
}
#[RequestMapping(path: 'city',methods: 'GET')]
#[Scene(scene: 'city')]
public function getCityList()
{
return (new CityListService)->handle();
}
#[RequestMapping(path: 'mini_wx/about_us',methods: 'GET')]
#[Scene(scene: 'mini_wx_config')]
public function getMiniWxConfig()
{
return (new MiniWxConfigService)->handle();
}
#[RequestMapping(path: 'config',methods: 'GET')]
#[Scene(scene: 'config')]
public function systemConfig()
{
return (new SystemConfigService)->handle();
}
#[RequestMapping(path: 'index',methods: 'GET')]
#[Scene(scene: 'index')]
#[Middleware(JwtAuthMiddleware::class)]
public function index(): array
{
return (new IndexService)->handle();
}
/**
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[RequestMapping(path: "sts/accredit", methods: "GET")]
#[Scene(scene: 'sts_accredit')]
#[Middleware(JwtAuthMiddleware::class)]
public function aliSts()
{
return (new AliStsService)->handle();
}
}