master
parent
4e17b59003
commit
0f37197cc3
2
pom.xml
2
pom.xml
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>cn.cloudowr</groupId>
|
<groupId>cn.cloudowr</groupId>
|
||||||
<artifactId>sdk</artifactId>
|
<artifactId>sdk</artifactId>
|
||||||
<version>1.3.4</version>
|
<version>1.3.6</version>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ public abstract class AbsController extends cn.cloudowr.sdk.jfinal.Controller im
|
||||||
Document $set = document.get("$set", Document.class);
|
Document $set = document.get("$set", Document.class);
|
||||||
if ($set != null) {
|
if ($set != null) {
|
||||||
$set.forEach((key, value) -> {
|
$set.forEach((key, value) -> {
|
||||||
|
if ("_id".equals(key)) return;
|
||||||
updateOps.add(Updates.set(key, value));
|
updateOps.add(Updates.set(key, value));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package cn.cloudowr.sdk.jfinal;
|
||||||
|
|
||||||
|
import com.jfinal.aop.Interceptor;
|
||||||
|
import com.jfinal.aop.Invocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lyf66 on 2017/2/16.
|
||||||
|
*/
|
||||||
|
public class JSONInterceptor implements Interceptor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void intercept(Invocation inv) {
|
||||||
|
String json = inv.getController().getPara("json");
|
||||||
|
if (json != null && !json.isEmpty()) {
|
||||||
|
inv.invoke();
|
||||||
|
} else {
|
||||||
|
inv.getController().render(new ErrorRender(400, "json must not be null"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue