feat: chef

This commit is contained in:
2025-01-14 17:36:32 +08:00
parent 63a3ad6d30
commit 789f753b24
4 changed files with 65 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Cache\Redis\Common;
use App\Cache\Redis\RedisCache;
use App\Model\Config;
use App\Model\Cycle;
use Hyperf\Di\Annotation\Inject;
class ConfigCache
{
/**
* @var RedisCache
*/
#[Inject]
protected RedisCache $redis;
/**
* @var Config $configModel
*/
#[Inject]
protected Config $configModel;
public function setConfigCacheByPid($pid)
{
$key = CommonRedisKey::getSystemConfigList($pid);
if ($this->redis->exists($key,'system')) return json_decode($this->redis->get($key),true);
return [];
}
}