wallet tron transactions

This commit is contained in:
cano
2024-03-25 06:15:36 +08:00
parent 4b8f205e86
commit 489090382f
83 changed files with 5424 additions and 1343 deletions

View File

@ -0,0 +1,42 @@
<?php
namespace App\Cache\Base;
use Illuminate\Support\Facades\Cache;
abstract class KeyBaseCache
{
protected string $prefix = 'Key:'; //缓存前缀
const CACHE_TTL = 60 * 60 * 24 * 3; //缓存时间 3天
function getByKey($key): string|array|bool|null
{
return Cache::get($key);
}
function setKey($key, $value): bool
{
return Cache::put($this->getKey($key), $value);
}
function setKeyWithExp($key, $value, $exp = self::CACHE_TTL): bool
{
return Cache::put($this->getKey($key), $value, $exp);
}
function getPrefix(): string
{
return $this->prefix;
}
function getKey($key): string
{
return $this->getPrefix().$key;
}
function removeKey($key): bool
{
return Cache::forget($this->getKey($key));
}
}