2020-01-11 13:36:52 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Utils;
|
|
|
|
|
|
|
|
class CacheKey
|
|
|
|
{
|
2020-03-13 14:32:36 +08:00
|
|
|
CONST KEYS = [
|
|
|
|
'EMAIL_VERIFY_CODE' => '邮箱验证吗',
|
2020-06-05 00:25:15 +08:00
|
|
|
'LAST_SEND_EMAIL_VERIFY_TIMESTAMP' => '最后一次发送邮箱验证码时间',
|
2020-07-03 15:24:10 +08:00
|
|
|
'SERVER_V2RAY_ONLINE_USER' => '节点在线用户',
|
|
|
|
'SERVER_V2RAY_LAST_CHECK_AT' => '节点最后检查时间',
|
2020-06-11 21:50:18 +08:00
|
|
|
'SERVER_TROJAN_ONLINE_USER' => 'trojan节点在线用户',
|
|
|
|
'SERVER_TROJAN_LAST_CHECK_AT' => 'trojan节点最后检查时间'
|
2020-03-13 14:32:36 +08:00
|
|
|
];
|
2020-01-11 13:36:52 +08:00
|
|
|
|
2020-03-13 14:37:28 +08:00
|
|
|
public static function get(string $key, $uniqueValue)
|
2020-03-13 14:32:36 +08:00
|
|
|
{
|
|
|
|
if (!in_array($key, array_keys(self::KEYS))) {
|
|
|
|
abort(500, 'key is not in cache key list');
|
|
|
|
}
|
|
|
|
return $key . '_' . $uniqueValue;
|
|
|
|
}
|
2020-01-11 13:36:52 +08:00
|
|
|
}
|