Files
hdk-core/src/Middleware/ExtendsMiddleware.php
2023-01-13 22:39:08 +08:00

31 lines
763 B
PHP

<?php
namespace Singularity\HDK\Core\Middleware;
use Hyperf\Di\Annotation\Inject;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Singularity\HDK\Core\Service\ExtendService;
/**
* 扩展资源中间件
*/
class ExtendsMiddleware implements MiddlewareInterface
{
/**
* @var \Singularity\HDK\Core\Service\ExtendService
*/
#[Inject]
private ExtendService $service;
/**
* @inheritDoc
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->service->parse($request);
return $handler->handle($request);
}
}