|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.dsideal.ZhuQue;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
|
|
import com.cybermkd.mongo.kit.MongoQuery;
|
|
|
|
|
import com.cybermkd.mongo.plugin.MongoJFinalPlugin;
|
|
|
|
|
import com.dsideal.ZhuQue.Handler.XssHandler;
|
|
|
|
|
import com.dsideal.ZhuQue.Index.Controller.IndexController;
|
|
|
|
|
import com.dsideal.ZhuQue.Interceptor.*;
|
|
|
|
@ -117,6 +119,14 @@ public class Start extends JFinalConfig {
|
|
|
|
|
RedisPlugin redis = new RedisPlugin("Redis", PropKit.get("redis_ip"), PropKit.getInt("redis_port"), 10 * 1000, PropKit.get("redis_password"));
|
|
|
|
|
//启动redis组件
|
|
|
|
|
me.add(redis);
|
|
|
|
|
|
|
|
|
|
//集成MongoDb
|
|
|
|
|
MongoJFinalPlugin jFinalPlugin = new MongoJFinalPlugin();
|
|
|
|
|
jFinalPlugin.add(PropKit.get("mongodb_ip"), PropKit.getInt("mongodb_port"));
|
|
|
|
|
jFinalPlugin.setDatabase(PropKit.get("mongodb_dbname"));
|
|
|
|
|
jFinalPlugin.auth(PropKit.get("mongodb_username"), PropKit.get("mongodb_password"));
|
|
|
|
|
me.add(jFinalPlugin);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -163,5 +173,11 @@ public class Start extends JFinalConfig {
|
|
|
|
|
String path = Start.class.getClassLoader().getResource("fzby.txt").getPath();
|
|
|
|
|
File file = new File(path);
|
|
|
|
|
System.out.println(FileUtil.readUtf8String(file));
|
|
|
|
|
|
|
|
|
|
//https://t-baby.gitbooks.io/mongodb-plugin/content/mongoquery.html
|
|
|
|
|
//测试一下MongoDB
|
|
|
|
|
MongoQuery query = new MongoQuery();
|
|
|
|
|
var List = query.use("equipment").findAll();
|
|
|
|
|
System.out.println(List);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|