...
|
...
|
@@ -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);
|
...
|
...
|
|