feat : kitchen
This commit is contained in:
42
app/Service/ServiceTrait/Common/SiteTrait.php
Normal file
42
app/Service/ServiceTrait/Common/SiteTrait.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\ServiceTrait\Common;
|
||||
|
||||
use App\Cache\Redis\Common\CommonRedisKey;
|
||||
use App\Cache\Redis\RedisCache;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
trait SiteTrait
|
||||
{
|
||||
/**
|
||||
* @var RedisCache
|
||||
*/
|
||||
#[Inject]
|
||||
protected RedisCache $redisCache;
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @param string $lng
|
||||
* @param string $lat
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws \RedisException
|
||||
*/
|
||||
public function setSiteCache($value, string $lng = '0', string $lat = '0'): void
|
||||
{
|
||||
$key = CommonRedisKey::getActivateSiteList();
|
||||
$this->redisCache->zRem($key,$value,'system');
|
||||
$this->redisCache->geoAdd($key,$lng,$lat,$value,'system');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user