Commit 0c0cef90 by fsn

调整包结构,注释完善

parent 09537566
package com.stylefeng.guns.common.constant;
/**
* 缓存名称
* 所有缓存名称的集合
*
* @author fengshuonan
* @date 2017-04-24 21:56
*/
public interface Cache {
/**
* 常量缓存
*/
String CONSTANT = "CONSTANT";
}
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stylefeng.guns.core.support.cache;
package com.stylefeng.guns.core.cache;
/**
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.stylefeng.guns.core.support.cache;
package com.stylefeng.guns.core.cache;
import java.util.List;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stylefeng.guns.core.support.cache;
package com.stylefeng.guns.core.cache;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stylefeng.guns.core.support.cache;
package com.stylefeng.guns.core.cache;
import java.util.List;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stylefeng.guns.core.support.cache;
package com.stylefeng.guns.core.cache;
/**
* 数据重载
......
......@@ -3,7 +3,7 @@ package com.stylefeng.guns.cache;
import com.alibaba.fastjson.JSON;
import com.stylefeng.guns.base.BaseTest;
import com.stylefeng.guns.common.constant.factory.ConstantFactory;
import com.stylefeng.guns.core.support.cache.CacheKit;
import com.stylefeng.guns.core.cache.CacheKit;
import org.junit.Test;
import java.util.List;
......@@ -26,17 +26,38 @@ public class CacheTest extends BaseTest{
public void testNoCache(){
long beginTIme = System.currentTimeMillis();
for(int i = 1;i<2000000;i++){
String singleRoleName = ConstantFactory.me().getSingleRoleName(1);
}
//for(int i = 1;i<2000000;i++){
String singleRoleName1 = ConstantFactory.me().getDeptName(1);
String singleRoleName2 = ConstantFactory.me().getDeptName(2);
String singleRoleName3 = ConstantFactory.me().getDeptName(14);
String singleRoleName4 = ConstantFactory.me().getDeptName(15);
System.out.println(singleRoleName1);
System.out.println(singleRoleName2);
System.out.println(singleRoleName3);
System.out.println(singleRoleName4);
String singleRoleName = ConstantFactory.me().getSingleRoleName(1);
System.out.println(singleRoleName);
//}
System.out.println();
System.out.println();
System.out.println(System.currentTimeMillis() - beginTIme);
Object constant = CacheKit.get("CONSTANT", "101");
System.out.println();
System.out.println();
Object constant = CacheKit.get("CONSTANT", 1);
System.out.println(constant);
List constant1 = CacheKit.getKeys("CONSTANT");
System.out.println(JSON.toJSONString(constant1));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment