ht
parent
0d24781dfc
commit
6ab0d64546
|
|
@ -21,7 +21,7 @@ import java.util.Map;
|
||||||
/**
|
/**
|
||||||
* Created by lyf66 on 2017/2/16.
|
* Created by lyf66 on 2017/2/16.
|
||||||
*/
|
*/
|
||||||
public class Controller extends com.jfinal.core.Controller{
|
public class Controller extends com.jfinal.core.Controller {
|
||||||
public void index() {
|
public void index() {
|
||||||
renderText("2");
|
renderText("2");
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,15 @@ public class Controller extends com.jfinal.core.Controller{
|
||||||
Map<String, String[]> paraMap = getParaMap();
|
Map<String, String[]> paraMap = getParaMap();
|
||||||
Document dict = new Document();
|
Document dict = new Document();
|
||||||
paraMap.forEach((key, arr) -> {
|
paraMap.forEach((key, arr) -> {
|
||||||
|
if (arr.length == 1) {
|
||||||
dict.put(key, arr[0]);
|
dict.put(key, arr[0]);
|
||||||
|
} else if (arr.length > 1) {
|
||||||
|
List<String> s = new ArrayList<>();
|
||||||
|
for (String s1 : arr) {
|
||||||
|
s.add(s1);
|
||||||
|
}
|
||||||
|
dict.put(key, s);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
getCollection().insertOne(dict);
|
getCollection().insertOne(dict);
|
||||||
renderJson(dict.toJson());
|
renderJson(dict.toJson());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue