DUZHI 博客系统开源项目

我要开发同款
匿名用户2017年02月25日
32阅读
所属分类Java、建站系统、开源博客系统
授权协议LGPL

作品详情

DUZHI_BLOG基于Jpress 进行更新而来的。在上面做了一系列升级,修复bug,等等。

在基础上增加了如下功能;

1、升级Jfinal3.0、Jfinal-weixin1.8

2、增加lucenesearch全文搜索引擎

3、增加用户中心

4、增加用户中心等功能

5、优化微信渠道内容,避免无法搜索的场景,解决应用型问题

6、自带一套与官网一致的主题

组件Jfinal

这个就不说了,一个MVC框架。

Ehcache

缓存框架,因为这个里面考虑的是本地的缓存所以,单机模式,所以在缓存的方案基本是懒加载以及缓存加载模式

    public User getUser() {        if (user != null)            return user;        if (getUserId() == null)            return null;        user = UserQuery.me().findById(getUserId());        return user;    }

上面是个Content模型中获取用户的模式。再举个缓存的例子;

    if (ActionCacheManager.isCloseActionCache()) {            next.handle(target, request, response, isHandled);            return;        }        Action action = JFinal.me().getAction(target, urlPara);        if (action == null) {            next.handle(target, request, response, isHandled);            return;        }        ActionCache actionCache = action.getMethod().getAnnotation(ActionCache.class);        if (actionCache == null) {            actionCache = action.getControllerClass().getAnnotation(ActionCache.class);            if (actionCache == null) {                next.handle(target, request, response, isHandled);                return;            }        }        String originalTarget = (String) request.getAttribute("_original_target");        String cacheKey = StringUtils.isNotBlank(originalTarget) ? originalTarget : target;        String queryString = request.getQueryString();        if (queryString != null) {            queryString = "?" + queryString;            cacheKey += queryString;        }        ActionCacheManager.enableCache(request);        ActionCacheManager.setCacheKey(request, cacheKey);        ActionCacheManager.setCacheContentType(request, actionCache.contentType());        String renderContent = ActionCacheManager.getCache(request, cacheKey);        if (renderContent != null) {            response.setContentType(actionCache.contentType());            PrintWriter writer = null;            try {                writer = response.getWriter();                writer.write(renderContent);                isHandled[0] = true;            } catch (Exception e) {                RenderFactory.me().getErrorRender(500).setContext(request, response, action.getViewPath()).render();            } finally {                if (writer != null) {                    writer.close();                }            }        } else {            next.handle(target, request, response, isHandled);        }

上面是ActionCacheHandler.java的代码。

db.properties

由于Jpress使用初始化模式,判断的就是db.properties有没有,所以如果没有数据库,已经表结构的情况下,建议使用懒汉模式一步一步安装即可。

    rm db.properties
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论