@Deprecated public abstract class _AbstractRedisWeChatCacheOperator<T extends AbstractWeChatCacheOperator.ExpireValue<V>,V> extends Object implements WeChatCacheOperator<T,V>
微信相关缓存抽象实现 基于RedisTemplate缓存,需在Spring中注册redisTemplate
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ACCESS_TOKEN_CACHE_KEY
已过时。
accessToken缓存key
格式 {cacheKeyPrefix}{AppID}
|
static String |
MP_TOKENS_CACHE_KEY
已过时。
token缓存key字符串
|
static int |
TEN_SECONDS
已过时。
|
| 构造器和说明 |
|---|
_AbstractRedisWeChatCacheOperator()
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
V |
get(String appId,
String key)
已过时。
获取缓存信息,缓存不存在时,获取新内容
|
T |
get(String appId,
String key,
Boolean isRefresh)
已过时。
获取缓存信息
|
T |
getCache(String appId,
String key)
已过时。
根据Key获取缓存信息
|
String |
getCacheKeyPrefix()
已过时。
|
Long |
getExpiresSeconds()
已过时。
|
String |
getFullKey(String key)
已过时。
获取缓存的完整key
格式: {cacheKeyPrefix}:{key}
|
abstract T |
getRaw(String appId)
已过时。
更具appId获取原始信息
|
V |
getValByAppId(String appId)
已过时。
获取App的缓存
|
V |
getValByDefaultKey()
已过时。
获取默认缓存具体值
|
V |
refreshByAppId(String appId)
已过时。
通过默认key刷新缓存
|
V |
refreshByDefaultKey()
已过时。
通过默认key刷新缓存
|
T |
refreshCache(String appId,
String key)
已过时。
刷新缓存
|
T |
removeCache(String appId,
String key)
已过时。
删除缓存
|
T |
saveCache(String appId,
String key,
T value,
Long expiresSeconds)
已过时。
保存缓存信息
|
void |
setCacheKeyPrefix(String cacheKeyPrefix)
已过时。
|
void |
setExpiresSeconds(Long expiresSeconds)
已过时。
|
public static String MP_TOKENS_CACHE_KEY
public static String ACCESS_TOKEN_CACHE_KEY
public static int TEN_SECONDS
public T getCache(String appId, String key)
getCache 在接口中 WeChatCacheOperator<T extends AbstractWeChatCacheOperator.ExpireValue<V>,V>key - 不含cacheKeyPrefix的keypublic V getValByDefaultKey()
public V get(String appId, String key)
get 在接口中 WeChatCacheOperator<T extends AbstractWeChatCacheOperator.ExpireValue<V>,V>public T get(String appId, String key, Boolean isRefresh)
key - 不含cachePrefixKeyisRefresh - 是否刷新缓存public T saveCache(String appId, String key, T value, Long expiresSeconds)
WeChatCacheOperatorsaveCache 在接口中 WeChatCacheOperator<T extends AbstractWeChatCacheOperator.ExpireValue<V>,V>expiresSeconds - 有效时间,单位spublic T removeCache(String appId, String key)
WeChatCacheOperatorremoveCache 在接口中 WeChatCacheOperator<T extends AbstractWeChatCacheOperator.ExpireValue<V>,V>public String getFullKey(String key)
key - public abstract T getRaw(String appId)
getRaw 在接口中 WeChatCacheOperator<T extends AbstractWeChatCacheOperator.ExpireValue<V>,V>public T refreshCache(String appId, String key)
WeChatCacheOperatorrefreshCache 在接口中 WeChatCacheOperator<T extends AbstractWeChatCacheOperator.ExpireValue<V>,V>public V refreshByDefaultKey()
public String getCacheKeyPrefix()
public void setCacheKeyPrefix(String cacheKeyPrefix)
public Long getExpiresSeconds()
public void setExpiresSeconds(Long expiresSeconds)
Copyright © 2020. All rights reserved.