Compare commits
7 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
42701b3976 | |
|
|
de311086e1 | |
|
|
99c9366be7 | |
|
|
8956885991 | |
|
|
bbcb412a47 | |
|
|
ceca66a1b4 | |
|
|
d4f8d6f2f7 |
34
pom.xml
34
pom.xml
|
|
@ -19,40 +19,6 @@
|
|||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.8.v20121106</version>
|
||||
<configuration>
|
||||
<stopKey>stop</stopKey>
|
||||
<stopPort>5200</stopPort>
|
||||
<webAppConfig>
|
||||
<contextPath>/</contextPath>
|
||||
</webAppConfig>
|
||||
<scanIntervalSeconds>5</scanIntervalSeconds>
|
||||
<connectors>
|
||||
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
|
||||
<port>4200</port>
|
||||
<maxIdleTime>60000</maxIdleTime>
|
||||
</connector>
|
||||
</connectors>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>java</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<mainClass>cn.cloudowr.dict.Main</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ public class Config extends com.jfinal.config.JFinalConfig {
|
|||
public void afterJFinalStart() {
|
||||
// MongoCredential mongoCredential = MongoCredential.createCredential("root", "admin", "CoWR1111".toCharArray());
|
||||
// MongoClient mongoClient = new MongoClient(new ServerAddress("120.24.5.249", 3717), Arrays.asList(mongoCredential));
|
||||
MongoClientURI connectionString = new MongoClientURI("mongodb://root:CoWR1111@dds-wz9ceed1f19591041217-pub.mongodb.rds.aliyuncs.com:3717,dds-wz9ceed1f19591042677-pub.mongodb.rds.aliyuncs.com:3717/admin?replicaSet=mgset-5320915");
|
||||
MongoClientURI connectionString = new MongoClientURI("mongodb://root:CoWR1111@dds-wz9ceed1f19591041.mongodb.rds.aliyuncs.com:3717,dds-wz9ceed1f19591042.mongodb.rds.aliyuncs.com:3717/admin?replicaSet=mgset-5320915");
|
||||
MongoClient mongoClient = new MongoClient(connectionString);
|
||||
mongoDatabase = mongoClient.getDatabase("dict");
|
||||
mongoDatabase = mongoClient.getDatabase("gxhy");
|
||||
}
|
||||
|
||||
public static MongoDatabase getMongoDataBase() {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package cn.cloudowr.dict;
|
||||
|
||||
import cn.cloudowr.sdk.FastJSONUtil;
|
||||
import cn.cloudowr.sdk.jfinal.AbsController;
|
||||
import cn.cloudowr.sdk.jfinal.IdInterceptor;
|
||||
import cn.cloudowr.sdk.jfinal.RestfulStyle;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.mongodb.client.FindIterable;
|
||||
import com.mongodb.client.MongoCollection;
|
||||
|
|
@ -22,7 +22,7 @@ import java.util.regex.Pattern;
|
|||
/**
|
||||
* Created by lyf66 on 2017/2/16.
|
||||
*/
|
||||
public class Controller extends cn.cloudowr.sdk.jfinal.Controller implements RestfulStyle {
|
||||
public class Controller extends AbsController {
|
||||
|
||||
@Override
|
||||
public void index() {
|
||||
|
|
@ -322,7 +322,7 @@ public class Controller extends cn.cloudowr.sdk.jfinal.Controller implements Res
|
|||
renderJson("result", result.getDeletedCount() == 1);
|
||||
}
|
||||
|
||||
private MongoCollection<Document> getCollection() {
|
||||
public MongoCollection<Document> getCollection() {
|
||||
MongoDatabase mongoDataBase = Config.getMongoDataBase();
|
||||
MongoCollection<Document> collection = mongoDataBase.getCollection("dict");
|
||||
return collection;
|
||||
|
|
|
|||
Loading…
Reference in New Issue