...
|
...
|
@@ -21,7 +21,7 @@ public abstract class AbstractCacheComponent<T> { |
|
|
|
|
|
public T queryWithCache(ParamQueryFilter paramQueryFilter, Map<String, String> paramMap) throws Exception {
|
|
|
//1、生成RedisKeyBuilder
|
|
|
RedisKeyBuilder redisKeyBuilder = this.genRedisKeyBuilder(paramQueryFilter);
|
|
|
RedisKeyBuilder redisKeyBuilder = this.genRedisKeyBuilder(paramQueryFilter,paramMap);
|
|
|
if (redisKeyBuilder == null) {
|
|
|
return null;
|
|
|
}
|
...
|
...
|
@@ -96,10 +96,19 @@ public abstract class AbstractCacheComponent<T> { |
|
|
return JSON.parseObject(redisValue, type);
|
|
|
}
|
|
|
|
|
|
protected abstract RedisKeyBuilder genRedisKeyBuilder(ParamQueryFilter paramQueryFilter);
|
|
|
|
|
|
protected abstract int cacheTimeInMinute();
|
|
|
|
|
|
protected abstract String cacheSceneKey();
|
|
|
|
|
|
protected RedisKeyBuilder genRedisKeyBuilder(ParamQueryFilter paramQueryFilter,Map<String,String> paramMap){
|
|
|
RedisKeyBuilder redisKeyBuilder = RedisKeyBuilder.newInstance();
|
|
|
redisKeyBuilder.appendFixed("YOHOSEARCH").appendFixed(":");//前缀
|
|
|
redisKeyBuilder.appendFixed(cacheSceneKey()).appendFixed(":");//场景
|
|
|
redisKeyBuilder.appendFixed(cacheTimeInMinute()).appendFixed(":");//缓存时间
|
|
|
redisKeyBuilder.appendVar(paramQueryFilter.getParamMd5Key());//报文
|
|
|
return redisKeyBuilder;
|
|
|
}
|
|
|
|
|
|
protected boolean useEhcache() {
|
|
|
return false;
|
|
|
}
|
...
|
...
|
|