37 lines
879 B
PHP
37 lines
879 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Test;
|
|
|
|
use App\Service\Test\Proxy\BasicSubjectService;
|
|
use App\Service\Test\Proxy\DynamicProxyService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
|
|
#[Controller(prefix: 'proxy/test')]
|
|
class ProxyController
|
|
{
|
|
/**
|
|
* @return array
|
|
*/
|
|
#[RequestMapping(path: 'basic', methods: 'GET')]
|
|
public function basic(): array
|
|
{
|
|
return (new BasicSubjectService)->handle();
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
#[RequestMapping(path: 'dynamic', methods: 'GET')]
|
|
public function dynamic(): array
|
|
{
|
|
return (new DynamicProxyService)->handle();
|
|
}
|
|
}
|