34 lines
747 B
PHP
34 lines
747 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Middleware\Admin\JwtAuthMiddleware;
|
|
use App\Request\Admin\DishRequest;
|
|
use App\Service\Admin\Material\DishService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middlewares;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Hyperf\Validation\Annotation\Scene;
|
|
|
|
#[Controller(prefix: 'admin/dish')]
|
|
#[Middlewares([
|
|
JwtAuthMiddleware::class,
|
|
])]
|
|
class DishController
|
|
{
|
|
/**
|
|
* @param DishRequest $request
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: "list", methods: "GET")]
|
|
#[Scene(scene: "list")]
|
|
public function list(DishRequest $request): array
|
|
{
|
|
return (new DishService)->dishList();
|
|
}
|
|
|
|
|
|
}
|