84 lines
2.3 KiB
PHP
84 lines
2.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Api;
|
|
|
|
use App\Controller\AbstractController;
|
|
use App\Middleware\Api\JwtAuthMiddleware;
|
|
use App\Service\Api\System\AliStsService;
|
|
use App\Service\Api\System\CityListService;
|
|
use App\Service\Api\System\GetLeaderboardService;
|
|
use App\Service\Api\System\MiniWxConfigService;
|
|
use App\Service\Api\System\SiteListService;
|
|
use App\Service\Api\System\SystemConfigService;
|
|
use App\Service\Api\User\IndexService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middleware;
|
|
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();
|
|
}
|
|
|
|
#[RequestMapping(path: "leaderboard", methods: "GET")]
|
|
#[Scene(scene: 'leaderboard')]
|
|
// #[Middleware(JwtAuthMiddleware::class)]
|
|
public function getLeaderboardHistory()
|
|
{
|
|
return (new GetLeaderboardService)->handle();
|
|
}
|
|
}
|