Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
0c0cef90
Commit
0c0cef90
authored
Apr 25, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整包结构,注释完善
parent
09537566
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
13 deletions
+37
-13
src/main/java/com/stylefeng/guns/common/constant/Cache.java
+4
-1
src/main/java/com/stylefeng/guns/core/cache/BaseCacheFactory.java
+1
-1
src/main/java/com/stylefeng/guns/core/cache/CacheKit.java
+1
-1
src/main/java/com/stylefeng/guns/core/cache/EhcacheFactory.java
+1
-1
src/main/java/com/stylefeng/guns/core/cache/ICache.java
+1
-1
src/main/java/com/stylefeng/guns/core/cache/ILoader.java
+1
-1
src/test/java/com/stylefeng/guns/cache/CacheTest.java
+28
-7
No files found.
src/main/java/com/stylefeng/guns/common/constant/Cache.java
View file @
0c0cef90
package
com
.
stylefeng
.
guns
.
common
.
constant
;
package
com
.
stylefeng
.
guns
.
common
.
constant
;
/**
/**
*
缓存名称
*
所有缓存名称的集合
*
*
* @author fengshuonan
* @author fengshuonan
* @date 2017-04-24 21:56
* @date 2017-04-24 21:56
*/
*/
public
interface
Cache
{
public
interface
Cache
{
/**
* 常量缓存
*/
String
CONSTANT
=
"CONSTANT"
;
String
CONSTANT
=
"CONSTANT"
;
}
}
src/main/java/com/stylefeng/guns/core/
support/
cache/BaseCacheFactory.java
→
src/main/java/com/stylefeng/guns/core/cache/BaseCacheFactory.java
View file @
0c0cef90
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
com
.
stylefeng
.
guns
.
core
.
support
.
cache
;
package
com
.
stylefeng
.
guns
.
core
.
cache
;
/**
/**
...
...
src/main/java/com/stylefeng/guns/core/
support/
cache/CacheKit.java
→
src/main/java/com/stylefeng/guns/core/cache/CacheKit.java
View file @
0c0cef90
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
package
com
.
stylefeng
.
guns
.
core
.
support
.
cache
;
package
com
.
stylefeng
.
guns
.
core
.
cache
;
import
java.util.List
;
import
java.util.List
;
...
...
src/main/java/com/stylefeng/guns/core/
support/
cache/EhcacheFactory.java
→
src/main/java/com/stylefeng/guns/core/cache/EhcacheFactory.java
View file @
0c0cef90
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* 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.Cache
;
import
net.sf.ehcache.CacheManager
;
import
net.sf.ehcache.CacheManager
;
...
...
src/main/java/com/stylefeng/guns/core/
support/
cache/ICache.java
→
src/main/java/com/stylefeng/guns/core/cache/ICache.java
View file @
0c0cef90
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
com
.
stylefeng
.
guns
.
core
.
support
.
cache
;
package
com
.
stylefeng
.
guns
.
core
.
cache
;
import
java.util.List
;
import
java.util.List
;
...
...
src/main/java/com/stylefeng/guns/core/
support/
cache/ILoader.java
→
src/main/java/com/stylefeng/guns/core/cache/ILoader.java
View file @
0c0cef90
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
com
.
stylefeng
.
guns
.
core
.
support
.
cache
;
package
com
.
stylefeng
.
guns
.
core
.
cache
;
/**
/**
* 数据重载
* 数据重载
...
...
src/test/java/com/stylefeng/guns/cache/CacheTest.java
View file @
0c0cef90
...
@@ -3,7 +3,7 @@ package com.stylefeng.guns.cache;
...
@@ -3,7 +3,7 @@ package com.stylefeng.guns.cache;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.stylefeng.guns.base.BaseTest
;
import
com.stylefeng.guns.base.BaseTest
;
import
com.stylefeng.guns.common.constant.factory.ConstantFactory
;
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
org.junit.Test
;
import
java.util.List
;
import
java.util.List
;
...
@@ -26,17 +26,38 @@ public class CacheTest extends BaseTest{
...
@@ -26,17 +26,38 @@ public class CacheTest extends BaseTest{
public
void
testNoCache
(){
public
void
testNoCache
(){
long
beginTIme
=
System
.
currentTimeMillis
();
long
beginTIme
=
System
.
currentTimeMillis
();
for
(
int
i
=
1
;
i
<
2000000
;
i
++){
//for(int i = 1;i<2000000;i++){
String
singleRoleName
=
ConstantFactory
.
me
().
getSingleRoleName
(
1
);
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
);
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
);
System
.
out
.
println
(
constant
);
List
constant1
=
CacheKit
.
getKeys
(
"CONSTANT"
);
List
constant1
=
CacheKit
.
getKeys
(
"CONSTANT"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
constant1
));
System
.
out
.
println
(
JSON
.
toJSONString
(
constant1
));
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment