App_Controller_AbstractController.proxy.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. declare (strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace App\Controller;
  12. use Hyperf\Di\Annotation\Inject;
  13. use Hyperf\HttpServer\Contract\RequestInterface;
  14. use Hyperf\HttpServer\Contract\ResponseInterface;
  15. use Hyperf\Logger\LoggerFactory;
  16. use Psr\Container\ContainerInterface;
  17. use Psr\Log\LoggerInterface;
  18. abstract class AbstractController
  19. {
  20. use \Hyperf\Di\Aop\ProxyTrait;
  21. use \Hyperf\Di\Aop\PropertyHandlerTrait;
  22. function __construct()
  23. {
  24. $this->__handlePropertyHandler(__CLASS__);
  25. }
  26. #[Inject]
  27. protected ContainerInterface $container;
  28. #[Inject]
  29. protected RequestInterface $request;
  30. #[Inject]
  31. protected ResponseInterface $response;
  32. /**
  33. * @var LoggerInterface
  34. */
  35. private $logger;
  36. // public function __construct(LoggerFactory $loggerFactory)
  37. // {
  38. // $this->logger = $loggerFactory->get('admin_consumer:', 'default');
  39. // $this->logger->info("项目启动访问一次");
  40. // }
  41. }