Search in sources :

Example 1 with ZrLogConfig

use of com.zrlog.web.config.ZrLogConfig in project zrlog by 94fzb.

the class InstallController method installZrlog.

/**
 * 数据库检查通过后,根据填写信息,执行数据表,表数据的初始化
 */
public void installZrlog() {
    String home = getRequest().getScheme() + "://" + getRequest().getHeader("host") + getRequest().getContextPath() + "/";
    Map<String, String> dbConn = (Map<String, String>) JFinal.me().getServletContext().getAttribute("dbConn");
    Map<String, String> configMsg = new HashMap<>();
    configMsg.put("title", getPara("title"));
    configMsg.put("second_title", getPara("second_title"));
    configMsg.put("username", getPara("username"));
    configMsg.put("password", getPara("password"));
    configMsg.put("email", getPara("email"));
    configMsg.put("home", home);
    if (new InstallService(PathKit.getWebRootPath() + "/WEB-INF", dbConn, configMsg).install()) {
        render("/install/success.jsp");
        ZrLogConfig config = (ZrLogConfig) JFinal.me().getServletContext().getAttribute("config");
        // 通知启动插件,配置库连接等操作
        config.installFinish();
    }
}
Also used : HashMap(java.util.HashMap) ZrLogConfig(com.zrlog.web.config.ZrLogConfig) Map(java.util.Map) HashMap(java.util.HashMap) InstallService(com.zrlog.service.InstallService)

Aggregations

InstallService (com.zrlog.service.InstallService)1 ZrLogConfig (com.zrlog.web.config.ZrLogConfig)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1