feat: redis

This commit is contained in:
2025-01-21 16:20:16 +08:00
parent df78fc705d
commit 2beb8d9e55
32 changed files with 310 additions and 84 deletions

View File

@@ -2,7 +2,9 @@
namespace App\Service\ServiceTrait\Common;
use App\Cache\Redis\Common\ConfigCache;
use App\Cache\Redis\Common\CycleCache;
use App\Constants\ConfigCode;
use Hyperf\Di\Annotation\Inject;
trait CycleTrait
@@ -13,10 +15,22 @@ trait CycleTrait
#[Inject]
protected CycleCache $cycleCache;
/**
* @var ConfigCache
*/
#[Inject]
protected ConfigCache $configCache;
protected function initTodayCycleId()
{
$TodayCutOffTime = $this->configCache->getConfigValueByKey(ConfigCode::TODAY_CUT_OFF_TIME_KEY);
if (date('H:i:s') >= ($TodayCutOffTime)) {
$day = date('Y-m-d',strtotime('+1 day'));
} else {
$day = date('Y-m-d',strtotime('today'));
}
}
}