Skip to content

Commit cbb0bbd

Browse files
committed
增加切入类可配置项
1 parent fbdfa35 commit cbb0bbd

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/Aspect/ResponseAspect.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,28 @@
4545
*/
4646
class ResponseAspect extends AbstractAspect
4747
{
48+
/**
49+
* @Value("soar.cut_classes")
50+
* @var array
51+
*/
4852
public $classes;
53+
/**
54+
* @Value("soar")
55+
* @var array
56+
*/
4957
protected $config;
58+
/**
59+
* @Inject()
60+
* @var \Wilbur\HyperfSoar\SoarService
61+
*/
5062
protected $service;
5163

52-
public function __construct(ContainerInterface $container)
53-
{
54-
$this->service = $container->get(SoarService::class);
55-
$this->config = $container->get(ConfigInterface::class)->get('soar');
56-
$this->classes = $this->config['cut_classes'] ?? ['Hyperf\HttpServer\Response::json',];
57-
}
64+
// public function __construct(ContainerInterface $container)
65+
// {
66+
// $this->service = $container->get(SoarService::class);
67+
// $this->config = $container->get(ConfigInterface::class)->get('soar');
68+
// $this->classes = $this->config['cut_classes'] ?? ['Hyperf\HttpServer\Response::json',];
69+
// }
5870

5971
/**
6072
* @throws \Hyperf\Di\Exception\Exception

0 commit comments

Comments
 (0)