com.starxmind.piano.wechat.token.redis.RedisAccessTokenManager Maven / Gradle / Ivy
The newest version!
package com.starxmind.piano.wechat.token.redis;
import com.starxmind.bass.http.XHttp;
import com.starxmind.piano.wechat.token.core.AccessTokenManager;
import com.starxmind.piano.wechat.token.core.WeChatInfo;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
/**
* Redis型AccessToken管理器
*
* @author pizzalord
* @since 1.0
*/
public class RedisAccessTokenManager extends AccessTokenManager {
private static final String REDIS_KEY_ACCESS_TOKEN = "piano:wechat:access_token";
private final RedissonClient redissonClient;
public RedisAccessTokenManager(WeChatInfo weChatInfo, XHttp XHttp, RedissonClient redissonClient) {
super(weChatInfo, XHttp);
this.redissonClient = redissonClient;
}
@Override
protected boolean isAccessTokenInvalid() {
RBucket