12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Cache;
- use App\Libs\Utils;
- use Illuminate\Support\Facades\Redis;
- class PushCache
- {
- /**
- * 获取用户reg id
- * @param $uid
- * @return mixed
- */
- public static function getUserPushRegId($uid)
- {
- $cacheKey = Utils::getCacheKey('push.user', [$uid]);
- return Redis::get($cacheKey);
- }
- /**
- * 设置用户reg id
- * @param $uid
- * @param $regId
- * @return mixed
- */
- public static function setUserPushRegId($uid, $regId)
- {
- $cacheKey = Utils::getCacheKey('push.user', [$uid]);
- return Redis::set($cacheKey, $regId);
- }
- }
|