CacheKey.php 493 B

1234567891011121314151617181920
  1. <?php
  2. namespace App\Utils;
  3. class CacheKey
  4. {
  5. CONST KEYS = [
  6. 'EMAIL_VERIFY_CODE' => '邮箱验证吗',
  7. 'LAST_SEND_EMAIL_VERIFY_TIMESTAMP' => '最后一次发送邮箱验证码时间',
  8. 'SERVER_STAT' => '节点统计信息'
  9. ];
  10. public static function get(string $key, $uniqueValue)
  11. {
  12. if (!in_array($key, array_keys(self::KEYS))) {
  13. abort(500, 'key is not in cache key list');
  14. }
  15. return $key . '_' . $uniqueValue;
  16. }
  17. }