<?php
|
|
namespace App\Service;
|
|
use Hyperf\Redis\Redis;
|
use Hyperf\Di\Annotation\Inject;
|
use Hyperf\Config\Annotation\Value;
|
use App\Utils\Http;
|
class TransferService extends Http
|
{
|
use \Hyperf\Di\Aop\ProxyTrait;
|
use \Hyperf\Di\Aop\PropertyHandlerTrait;
|
function __construct()
|
{
|
if (method_exists(parent::class, '__construct')) {
|
parent::__construct(...func_get_args());
|
}
|
$this->__handlePropertyHandler(__CLASS__);
|
}
|
/**
|
*
|
* @Inject
|
* @var Redis
|
*/
|
private $redis;
|
public function ping()
|
{
|
$result = $this->redis->ping();
|
}
|
public function setnx($strKey, $value)
|
{
|
$this->redis->setnx($strKey, $value);
|
}
|
public function set($strKey, $value)
|
{
|
$this->redis->set($strKey, $value);
|
}
|
public function get($strKey)
|
{
|
return $this->redis->get($strKey);
|
}
|
public function delete($strKey)
|
{
|
$this->redis->del($strKey);
|
}
|
public function incrby($str_key, $value = 0)
|
{
|
$this->redis->incrby($str_key, $value);
|
}
|
public function incr($fd)
|
{
|
return $this->redis->incr($fd);
|
}
|
public function decr($strKey)
|
{
|
return $this->redis->decr($strKey);
|
}
|
public function decrby($strKey, $num)
|
{
|
return $this->redis->decrby($strKey, $num);
|
}
|
public function lSize($strKey)
|
{
|
return $this->redis->lSize($strKey);
|
}
|
public function lGet($strKey, $index)
|
{
|
return $this->redis->lGet($strKey, $index);
|
}
|
public function lrem($strKey, $value, $index)
|
{
|
return $this->redis->lrem($strKey, $value, $index);
|
}
|
public function lPush($strKey, $value)
|
{
|
$this->redis->lPush($strKey, $value);
|
}
|
public function rPush($strKey, $value)
|
{
|
$this->redis->rPush($strKey, $value);
|
}
|
public function lPop($strKey)
|
{
|
return $this->redis->lPop($strKey);
|
}
|
public function rPop($strKey)
|
{
|
return $this->redis->rPop($strKey);
|
}
|
public function lSet($strKey, $index, $value)
|
{
|
return $this->redis->lSet($strKey, $index, $value);
|
}
|
public function lrange($strKey, $index, $length)
|
{
|
return $this->redis->lrange($strKey, $index, $length);
|
}
|
public function keys($strKey)
|
{
|
return $this->redis->keys($strKey);
|
}
|
}
|