Files
hyperf_service/app/Controller/Api/ChefController.php
2025-04-09 10:13:40 +08:00

34 lines
824 B
PHP

<?php
declare(strict_types=1);
namespace App\Controller\Api;
use App\Middleware\Api\JwtAuthMiddleware;
use App\Service\Api\Chef\IndexService;
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;
#[Controller(prefix: 'api/chef')]
#[Middlewares([
JwtAuthMiddleware::class,
])]
class ChefController
{
/**
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[RequestMapping(path: "index", methods: "GET")]
#[Scene(scene: "index")]
public function index(): array
{
return (new IndexService)->handle();
}
}