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

@@ -5,6 +5,17 @@ namespace App\Cache\Redis\Common;
class CommonRedisKey class CommonRedisKey
{ {
/** /**
* 获取系统配置列表
* @param $pid
* @return string
*/
public static function getSystemConfigList($pid): string
{
return '__system:config:list:' . $pid;
}
/**
* 获取系统配置
* @return string * @return string
*@var string $type *@var string $type
*/ */

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 [];
}
}

View File

@@ -29,7 +29,7 @@ class ChefRequest extends FormRequest
'user_id' =>'required|integer|exists:chef,user_id', 'user_id' =>'required|integer|exists:chef,user_id',
'profile' =>'sometimes', 'profile' =>'sometimes',
'specialties' =>'sometimes', 'specialties' =>'sometimes',
'query_city_id' => 'sometimes|integer|exists:city,id', 'query_city_id' => 'sometimes|integer|exists:system_city,id',
]; ];
} }

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Service\ServiceTrait\Common;
use App\Cache\Redis\Common\CycleCache;
use Hyperf\Di\Annotation\Inject;
trait CycleTrait
{
/**
* @var CycleCache
*/
#[Inject]
protected CycleCache $cycleCache;
protected function initTodayCycleId()
{
}
}