DUZHI 博客系统

码农软件 · 软件分类 · 开源博客系统 · 2020-01-17 07:27:50

软件介绍

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

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

1、升级 Jfinal 3.0 、Jfinal-weixin 1.8

2、增加 lucene search 全文搜索引擎

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

本文地址:https://codercto.com/soft/d/23554.html

Perl语言编程

Perl语言编程

克里斯蒂安森 (Tom Christiansen) (作者)、Brian D Foy (作者)、Larry Wall (作者)、Jon Orwant (作者) / 苏金国 (译者)、吴爽 (译者) / 中国电力出版社 / 2014-9-1 / 148

从1991年第一版问世以来,《Perl语言编程》很快成为无可争议的Perl宝典,如今仍是这种高实用性语言的权威指南。Perl最初只是作为一个功能强大的文本处理工具,不过很快发展成为一种通用的编程语言,可以帮助成千上万的程序员、系统管理员,以及像你一样的技术爱好者轻松完成工作。 人们早已经翘首以待这本“大骆驼书”的更新,如今终于得偿所愿。在这一版中,三位颇有声望的Perl作者讲述了这种语言当前......一起来看看 《Perl语言编程》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

随机密码生成器
随机密码生成器

多种字符组合密码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换