...
|
...
|
@@ -32,7 +32,6 @@ public class BasicDataCacheService { |
|
|
|
|
|
//YOHO
|
|
|
private static final String BRAND_CACHE_KEY = "brand";
|
|
|
private static final String BRAND_NAME_CACHE_KEY = "brandName";
|
|
|
private static final String SORT_CACHE_KEY = "sort";
|
|
|
private static final String SORT_MAP_LIST_CACHE_KEY = "sortMapList";
|
|
|
private static final String SHOP_CACHE_KEY = "shop";
|
...
|
...
|
@@ -56,7 +55,7 @@ public class BasicDataCacheService { |
|
|
private static final String UFO_SORT_RELATION_CACHE_KEY = "ufoSortRelation";
|
|
|
private static final String UFO_SORT_RELATION_REVERSE_CACHE_KEY = "ufoSortRelationReverse";
|
|
|
|
|
|
//有货品牌
|
|
|
//有货 品牌id->品牌
|
|
|
LoadingCache<String, Map<Integer, Brand>> brandCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, Map<Integer, Brand>>() {
|
...
|
...
|
@@ -78,31 +77,7 @@ public class BasicDataCacheService { |
|
|
brandCache.invalidateAll();
|
|
|
}
|
|
|
|
|
|
|
|
|
//有货品牌名称->id
|
|
|
LoadingCache<String, Map<String, Integer>> brandNameCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, Map<String, Integer>>() {
|
|
|
public Map<String, Integer> load(String key) {
|
|
|
return basicDataLogicService.getBrandNameMap();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
public Map<String, Integer> getBrandNameMap() {
|
|
|
try {
|
|
|
return brandNameCache.get(BRAND_NAME_CACHE_KEY);
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage());
|
|
|
return new HashMap<>();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void clearBrandName() {
|
|
|
brandNameCache.invalidateAll();
|
|
|
}
|
|
|
|
|
|
|
|
|
//有货品类
|
|
|
//有货 品类id->品类
|
|
|
LoadingCache<String, Map<Integer, ProductSort>> productSortCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, Map<Integer, ProductSort>>() {
|
...
|
...
|
@@ -125,7 +100,7 @@ public class BasicDataCacheService { |
|
|
}
|
|
|
|
|
|
|
|
|
//有货店铺
|
|
|
//有货 店铺id->店铺
|
|
|
LoadingCache<String, Map<Integer, Shops>> shopCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, Map<Integer, Shops>>() {
|
...
|
...
|
@@ -148,7 +123,7 @@ public class BasicDataCacheService { |
|
|
}
|
|
|
|
|
|
|
|
|
//有货颜色id->颜色
|
|
|
//有货 颜色id->颜色
|
|
|
LoadingCache<String, Map<Integer, ProductColor>> colorCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, Map<Integer, ProductColor>>() {
|
...
|
...
|
@@ -170,7 +145,7 @@ public class BasicDataCacheService { |
|
|
colorCache.invalidateAll();
|
|
|
}
|
|
|
|
|
|
//有货颜色名称->颜色 (用于UFO颜色融合)
|
|
|
//有货 颜色名称->颜色 (用于UFO颜色融合)
|
|
|
LoadingCache<String, Map<String, ProductColor>> colorNameCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, Map<String, ProductColor>>() {
|
...
|
...
|
@@ -332,7 +307,7 @@ public class BasicDataCacheService { |
|
|
}
|
|
|
|
|
|
|
|
|
//全球购用品类映射
|
|
|
//全球购 品类映射
|
|
|
LoadingCache<String, List<HashMap<Integer, Integer>>> sortCache = CacheBuilder.newBuilder()
|
|
|
.expireAfterWrite(10, TimeUnit.MINUTES)
|
|
|
.build(new CacheLoader<String, List<HashMap<Integer, Integer>>>() {
|
...
|
...
|
|