From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/util/EhcacheUtil.java | 96 ++++++++++++++++++++++++------------------------ 1 files changed, 48 insertions(+), 48 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/EhcacheUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/EhcacheUtil.java index 8174356..a590f5c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/EhcacheUtil.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/EhcacheUtil.java @@ -1,48 +1,48 @@ -package com.yeshi.fanli.util; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.config.CacheConfiguration; - -public class EhcacheUtil { - - public static CacheManager cacheManager = CacheManager.getInstance(); - - public static Cache addCahae(CacheConfiguration cacheConfiguration){ - cacheManager.addCache(new Cache(cacheConfiguration)); - return cacheManager.getCache(cacheConfiguration.getName()); - } - - public static void removeCache(String name){ - cacheManager.removeCache(name); - } - - public static Cache getCache(String name){ - return cacheManager.getCache(name); - } - - public static CacheConfiguration getMyPubCacheConfig(String name){ - CacheConfiguration cacheConfiguration = new CacheConfiguration(); - cacheConfiguration.setMaxElementsInMemory(1000); - cacheConfiguration.setMaxElementsOnDisk(10000); - cacheConfiguration.setEternal(false); - cacheConfiguration.setTimeToIdleSeconds(Constant.DAYMS); - cacheConfiguration.setTimeToLiveSeconds(Constant.DAYMS); - cacheConfiguration.setOverflowToDisk(true); - cacheConfiguration.setMemoryStoreEvictionPolicy("LRU"); - cacheConfiguration.setName(name); - return cacheConfiguration; - } - - public static CacheConfiguration getOneDayCacheConfig(String name){ - CacheConfiguration cacheConfiguration = new CacheConfiguration(); - cacheConfiguration.setMaxElementsInMemory(1000); - cacheConfiguration.setMaxElementsOnDisk(10000); - cacheConfiguration.setEternal(false); - cacheConfiguration.setTimeToLiveSeconds(86400000); - cacheConfiguration.setOverflowToDisk(true); - cacheConfiguration.setMemoryStoreEvictionPolicy("LRU"); - cacheConfiguration.setName(name); - return cacheConfiguration; - } -} +package com.yeshi.fanli.util; + +import net.sf.ehcache.Cache; +import net.sf.ehcache.CacheManager; +import net.sf.ehcache.config.CacheConfiguration; + +public class EhcacheUtil { + + public static CacheManager cacheManager = CacheManager.getInstance(); + + public static Cache addCahae(CacheConfiguration cacheConfiguration){ + cacheManager.addCache(new Cache(cacheConfiguration)); + return cacheManager.getCache(cacheConfiguration.getName()); + } + + public static void removeCache(String name){ + cacheManager.removeCache(name); + } + + public static Cache getCache(String name){ + return cacheManager.getCache(name); + } + + public static CacheConfiguration getMyPubCacheConfig(String name){ + CacheConfiguration cacheConfiguration = new CacheConfiguration(); + cacheConfiguration.setMaxElementsInMemory(1000); + cacheConfiguration.setMaxElementsOnDisk(10000); + cacheConfiguration.setEternal(false); + cacheConfiguration.setTimeToIdleSeconds(Constant.DAYMS); + cacheConfiguration.setTimeToLiveSeconds(Constant.DAYMS); + cacheConfiguration.setOverflowToDisk(true); + cacheConfiguration.setMemoryStoreEvictionPolicy("LRU"); + cacheConfiguration.setName(name); + return cacheConfiguration; + } + + public static CacheConfiguration getOneDayCacheConfig(String name){ + CacheConfiguration cacheConfiguration = new CacheConfiguration(); + cacheConfiguration.setMaxElementsInMemory(1000); + cacheConfiguration.setMaxElementsOnDisk(10000); + cacheConfiguration.setEternal(false); + cacheConfiguration.setTimeToLiveSeconds(86400000); + cacheConfiguration.setOverflowToDisk(true); + cacheConfiguration.setMemoryStoreEvictionPolicy("LRU"); + cacheConfiguration.setName(name); + return cacheConfiguration; + } +} -- Gitblit v1.8.0