mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore.git
synced 2026-01-15 07:15:06 +08:00
31 lines
763 B
PHP
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);
|
|
}
|
|
}
|