Skip to content

Commit

Permalink
修改启动缓存bug、jfinal升级为3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbiao committed Sep 4, 2018
1 parent 5a77bce commit 8186be1
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 17 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,48 +80,100 @@ support
------------------------

| 名字 | 金额 | 备注 | 时间 |

| :-------: |:----: | :-----:|----- |-----|


| 阿楞 | ¥100.00 | 微信捐赠 | 2018-08-23 11:03|

| 欣喜若狂 | ¥50.00 | 支付宝捐赠 | 2018-01-12 18:10|

| 欣喜若狂 | ¥50.00 | 支付宝捐赠 | 2018-01-12 18:10|

| 奥里吉德 | ¥50.00 | 支付宝捐赠 | 2017-08-20 20:10|

| 错觉 | ¥20.00 | 微信捐赠 | 2017-07-18 18:34|

| 弱水穿云天 | ¥50.00 | 支付宝捐赠 | 2017-04-28 10:17|

| 牛牛 | ¥100.00 | 微信捐赠 | 2017-04-17 17:36|

| 2001来北京的麦田 | ¥50.00 | 微信捐赠 | 2017-03-09 16:58|

| 今生的你 | ¥20.00 | 支付宝捐赠 | 2017-02-13 12:32|

| 建强 | ¥500.00 | 支付宝捐赠 | 2017-01-19 23:04|

| 小军 | ¥10.00 | 支付宝捐赠 | 2016-11-30 22:58|

| 小军 | ¥10.00 | 支付宝捐赠 | 2016-11-19 09:34|

| 郑州誉品电子商务有限公司 | ¥300.00 | 支付宝捐赠 | 2016-09-23 14:13|

| 周克涛 | ¥10.00 | 支付宝捐赠 | 2016-08-12 19:43|

| 扬某 | ¥1.00 | 支付宝捐赠 | 2016-06-29 14:12|

| magicbug | ¥500.00 | 支付宝捐赠 | 2016-06-20 15:14|

| 杜育轩 | ¥100.00 | 支付宝捐赠 | 2016-05-29 10:48|

| 谢协湃 | ¥20.00 | 支付宝捐赠 | 2016-05-01 22:33|

| 粪发涂墙 | ¥1.00 | 微信捐赠 | 2016-04-17 21:18|

| 胡海峰 | ¥10.00 | 微信捐赠 | 2016-04-12 15:23|

| 李守敬 | ¥10.00 | 支付宝捐赠 | 2016-03-10 17:20|

| 韩千叶 | ¥20.00 | 支付宝捐赠 | 2016-03-05 18:35|

| 神仙下凡 | ¥1.00 | 微信捐赠 | 2016-03-03 18:30|

| 张润佘 | ¥1.00 | 支付宝捐赠 | 2016-03-01 21:18|

| 李胜发 | ¥20.00 | 支付宝捐赠 | 2016-02-23 22:25|

| 贾小龙 | ¥20.00 | 微信捐赠 | 2016-02-20 15:20|

| 韩刚龙 | ¥20.00 | 支付宝捐赠 | 2016-02-10 16:17|

| 黄颖 | ¥10.00 | 支付宝捐赠 | 2016-02-08 16:25|

| 孔维源 | ¥20.00 | 支付宝捐赠 | 2016-02-07 18:40|

| 小猪 | ¥10.00 | 微信捐赠 | 2016-02-07 18:20|

| 田野 | ¥20.00 | 支付宝捐赠 | 2016-02-07 16:15|

| Allen | ¥10.00 | 支付宝捐赠 | 2016-02-07 15:25|

| 飞龙在天 | ¥20.00 | 微信捐赠 | 2016-02-05 15:20|

| 仇国林 | ¥5.00 | 支付宝捐赠 | 2016-02-05 16:17|

| 李荣富 | ¥50.00 | 支付宝捐赠 | 2016-01-05 14:15|

| 夏舒征 | ¥1.00 | 微信捐赠 | 2015-12-03 18:30|

| 郭俊立 | ¥10.00 | 支付宝捐赠 | 2015-11-23 21:25|

| 侯善稚 | ¥5.00 | 支付宝捐赠 | 2015-11-10 12:30|

| Dave | ¥20.00 | 微信捐赠 | 2015-09-05 15:10|

| 李具匡 | ¥1.00 | 支付宝捐赠 | 2015-08-03 23:30|

| 文子隐 | ¥20.00 | 微信捐赠 | 2015-07-23 19:20|

| 何望 | ¥10.00 | 支付宝捐赠 | 2015-07-10 17:29|

| 李新革 | ¥20.00 | 支付宝捐赠 | 2015-05-07 20:00|

| 苏某 | ¥20.00 | 支付宝捐赠 | 2015-04-01 20:18|

| 寒云 | ¥10.00 | 支付宝捐赠 | 2015-02-01 20:18|

| lucky | ¥10.00 | 支付宝捐赠 | 2015-01-20 15:10|

| 王锋 | ¥10.00 | 支付宝捐赠 | 2015-01-10 22:00|
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependency>
<groupId>com.jfinal</groupId>
<artifactId>jfinal</artifactId>
<version>3.0</version>
<version>3.4</version>
</dependency>
<dependency>
<groupId>com.jfinal</groupId>
Expand Down
29 changes: 15 additions & 14 deletions src/main/java/com/jflyfox/component/config/BaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,32 +205,22 @@ public void configInterceptor(Interceptors me) {
public void afterJFinalStart() {
super.afterJFinalStart();

JFlyFoxCache.init();
System.out.println("##################################");
System.out.println("############系统启动完成##########");
System.out.println("##################################");
}

@Override
public void beforeJFinalStop() {
super.afterJFinalStart();

// 初始化Cache为fst序列化
SerializerManage.add("fst", new FSTSerializer());

// 设置序列化工具
String defaultKey = Config.getStr("CACHE.SERIALIZER.DEFAULT");
defaultKey = StrUtils.isEmpty(defaultKey) ? "java" : defaultKey;
SerializerManage.setDefaultKey(defaultKey);


// 设置缓存
CacheManager.setCache(new ICacheManager() {

public Cache getCache() {
String cacheName = Config.getStr("CACHE.NAME");
cacheName = StrUtils.isEmpty(cacheName) ? "MemorySerializeCache" : cacheName;
cacheName = StrUtils.isEmpty(cacheName) ? "MemorySerializeCache" : cacheName;

if ("MemorySerializeCache".equals(cacheName)) {
return new MemorySerializeCache();
} else if ("MemoryCache".equals(cacheName)) {
Expand All @@ -243,9 +233,20 @@ public Cache getCache() {
}
});

JFlyFoxCache.init();
System.out.println("##################################");
System.out.println("############系统启动完成##########");
System.out.println("##################################");
}

@Override
public void beforeJFinalStop() {

// 关闭模板
// BeetlRenderFactory.groupTemplate.close();

super.beforeJFinalStop();

System.out.println("##################################");
System.out.println("############系统停止完成##########");
System.out.println("##################################");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jflyfox/jfinal/base/BaseModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void clearCache(String cacheName) {
}

public Map<String, Object> getAttrs() {
return super.getAttrs();
return super._getAttrs();
}

public Object[] getAttrValues() {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/conf/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ CMS.ARTICLE_APPROVE=false
########################ATTR
ATTR.SESSION_NAME=session_user
ATTR.SESSION_IS_MOILE=flyfox_is_moile
ATTR.SESSION_NAME=session_user
ATTR.ATTR_NAME=attr
ATTR.MODEL_NAME=model
ATTR.FORM_NAME=form
Expand Down

0 comments on commit 8186be1

Please sign in to comment.