PushCache.php 633 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Cache;
  3. use App\Libs\Utils;
  4. use Illuminate\Support\Facades\Redis;
  5. class PushCache
  6. {
  7. /**
  8. * 获取用户reg id
  9. * @param $uid
  10. * @return mixed
  11. */
  12. public static function getUserPushRegId($uid)
  13. {
  14. $cacheKey = Utils::getCacheKey('push.user', [$uid]);
  15. return Redis::get($cacheKey);
  16. }
  17. /**
  18. * 设置用户reg id
  19. * @param $uid
  20. * @param $regId
  21. * @return mixed
  22. */
  23. public static function setUserPushRegId($uid, $regId)
  24. {
  25. $cacheKey = Utils::getCacheKey('push.user', [$uid]);
  26. return Redis::set($cacheKey, $regId);
  27. }
  28. }