2020-01-11 13:36:52 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Utils;
|
|
|
|
|
|
|
|
class CacheKey
|
|
|
|
{
|
2020-03-13 14:32:36 +08:00
|
|
|
CONST KEYS = [
|
2020-11-19 21:21:21 +08:00
|
|
|
'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' => '节点最后检查时间',
|
2021-03-24 15:04:09 +08:00
|
|
|
'SERVER_V2RAY_LAST_PUSH_AT' => '节点最后推送时间',
|
2020-06-11 21:50:18 +08:00
|
|
|
'SERVER_TROJAN_ONLINE_USER' => 'trojan节点在线用户',
|
2020-08-13 21:36:59 +08:00
|
|
|
'SERVER_TROJAN_LAST_CHECK_AT' => 'trojan节点最后检查时间',
|
2021-03-24 15:04:09 +08:00
|
|
|
'SERVER_TROJAN_LAST_PUSH_AT' => 'trojan节点最后推送时间',
|
2020-10-04 14:21:09 +08:00
|
|
|
'SERVER_SHADOWSOCKS_ONLINE_USER' => 'ss节点在线用户',
|
|
|
|
'SERVER_SHADOWSOCKS_LAST_CHECK_AT' => 'ss节点最后检查时间',
|
2021-03-24 15:04:09 +08:00
|
|
|
'SERVER_SHADOWSOCKS_LAST_PUSH_AT' => 'ss节点最后推送时间',
|
2020-09-23 23:15:43 +08:00
|
|
|
'TEMP_TOKEN' => '临时令牌',
|
2021-08-21 15:20:16 +08:00
|
|
|
'LAST_SEND_EMAIL_REMIND_TRAFFIC' => '最后发送流量邮件提醒'
|
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
|
|
|
}
|