Authored by hugufei

fix缓存

... ... @@ -35,6 +35,9 @@ public class BacthSknInfoComponent {
private static final boolean useEhCache = true;
private static final int cacheTimeInSecond = 10;
/**
* 按skn查询并按顺序返回
*
... ... @@ -61,7 +64,7 @@ public class BacthSknInfoComponent {
//1、构建请求与返回结果
final List<CacheSknInfoRequestResponse> sknInfoCacheRequestRespons = new ArrayList<>();
for (Integer productSkn : productSkns) {
sknInfoCacheRequestRespons.add(new CacheSknInfoRequestResponse(productSkn,5 * 60 ));//缓存时间5分钟
sknInfoCacheRequestRespons.add(new CacheSknInfoRequestResponse(productSkn,cacheTimeInSecond));//缓存时间5分钟
}
//2、批量从缓存中获取
cacheRequestResponseHelper.batchFillResponseFromCache(sknInfoCacheRequestRespons,useEhCache);
... ...
... ... @@ -34,7 +34,7 @@ public class CacheSknInfoRequestResponse extends CacheRequestResponse<Integer, M
};
public CacheSknInfoRequestResponse(Integer productSkn, int cacheTimeInSecond) {
super(productSkn, requestRedisKeyBuilder, cacheTimeInSecond * 60, toResponseTransfer,fromResponseTransfer);
super(productSkn, requestRedisKeyBuilder, cacheTimeInSecond , toResponseTransfer,fromResponseTransfer);
}
}
... ...
... ... @@ -54,7 +54,7 @@ public class RecallResultBuilder {
}
});
//6、处理直通车
//TODO 6、处理直通车
//7、截取整数页
int recallMaxPage = (sknResultList.size() / pageSize);
... ...