feat : kitchen

This commit is contained in:
2024-11-08 16:27:25 +08:00
parent 79782dbb4e
commit c491fb79d8
15 changed files with 727 additions and 25 deletions

View 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');
}
}