diff --git a/app/Controller/Api/SystemController.php b/app/Controller/Api/SystemController.php index abe9537..5d621d6 100644 --- a/app/Controller/Api/SystemController.php +++ b/app/Controller/Api/SystemController.php @@ -13,6 +13,7 @@ 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 DateMalformedStringException; use Hyperf\HttpServer\Annotation\Controller; use Hyperf\HttpServer\Annotation\Middleware; use Hyperf\HttpServer\Annotation\RequestMapping; @@ -73,9 +74,15 @@ class SystemController extends AbstractController return (new AliStsService)->handle(); } + /** + * @return array|null + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + * @throws DateMalformedStringException + */ #[RequestMapping(path: "leaderboard", methods: "GET")] #[Scene(scene: 'leaderboard')] -// #[Middleware(JwtAuthMiddleware::class)] + #[Middleware(JwtAuthMiddleware::class)] public function getLeaderboardHistory() { return (new GetLeaderboardService)->handle(); diff --git a/app/Service/Api/Evaluation/EvaluationService.php b/app/Service/Api/Evaluation/EvaluationService.php index 48e460b..8dcd066 100644 --- a/app/Service/Api/Evaluation/EvaluationService.php +++ b/app/Service/Api/Evaluation/EvaluationService.php @@ -21,6 +21,8 @@ use App\Service\Api\BaseService; use App\Service\ServiceTrait\Common\OssTrait; use Hyperf\DbConnection\Db; use Hyperf\Di\Annotation\Inject; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use function Hyperf\Coroutine\co; class EvaluationService extends BaseService @@ -53,6 +55,8 @@ class EvaluationService extends BaseService /** * @return array + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function handle(): array { diff --git a/app/Service/Api/System/GetLeaderboardService.php b/app/Service/Api/System/GetLeaderboardService.php index 6bec794..6023319 100644 --- a/app/Service/Api/System/GetLeaderboardService.php +++ b/app/Service/Api/System/GetLeaderboardService.php @@ -19,7 +19,10 @@ use App\Model\LeaderboardHistory; use App\Model\SystemCity; use App\Service\Api\BaseService; use App\Service\ServiceTrait\Common\OssTrait; +use DateMalformedStringException; use Hyperf\Di\Annotation\Inject; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; class GetLeaderboardService extends BaseService { @@ -49,7 +52,13 @@ class GetLeaderboardService extends BaseService #[Inject] protected AdminUser $adminUserModel; - public function handle() + /** + * @return array + * @throws DateMalformedStringException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function handle(): array { $cityId = (int)$this->request->input('city_id'); $type = (int)$this->request->input('type');