mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 22:47:50 +08:00
31 lines
708 B
PHP
31 lines
708 B
PHP
<?php
|
|
|
|
namespace App\Cache\Redis;
|
|
|
|
use Hyperf\Redis\RedisProxy;
|
|
|
|
class RedisProxyWrapper
|
|
{
|
|
public function __construct(
|
|
protected readonly RedisProxy $redisProxy,
|
|
protected string $poolName
|
|
) {}
|
|
|
|
/**
|
|
* @param string $method
|
|
* @param array $arguments
|
|
* @return mixed
|
|
*/
|
|
public function __call(string $method, array $arguments)
|
|
{
|
|
return $this->redisProxy->{$method}(...$arguments);
|
|
}
|
|
|
|
public function lua(string $scriptClass)
|
|
{
|
|
// 这里实现你的 Lua 脚本逻辑
|
|
$key = $this->poolName . ':' . $scriptClass;
|
|
// 实际实现根据你的需求
|
|
return $this->redisProxy->eval($scriptClass, 0);
|
|
}
|
|
} |