App_Service_RedisInterface.proxy.php 940 B

1234567891011121314151617181920212223242526272829303132333435
  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\Service;
  12. use Hyperf\Di\Annotation\Inject;
  13. use Psr\Container\ContainerInterface;
  14. abstract class RedisInterface
  15. {
  16. use \Hyperf\Di\Aop\ProxyTrait;
  17. use \Hyperf\Di\Aop\PropertyHandlerTrait;
  18. protected $redis;
  19. #[Inject]
  20. protected ContainerInterface $container;
  21. public function __construct()
  22. {
  23. $this->__handlePropertyHandler(__CLASS__);
  24. /**
  25. * 生成图片验证码
  26. * @return string
  27. * @throws \Psr\Container\ContainerExceptionInterface
  28. * @throws \Psr\Container\NotFoundExceptionInterface
  29. * @throws \RedisException
  30. */
  31. $this->redis = $this->container->get(\Hyperf\Redis\Redis::class);
  32. }
  33. }