master
parent
4e17b59003
commit
0f37197cc3
2
pom.xml
2
pom.xml
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>cn.cloudowr</groupId>
|
||||
<artifactId>sdk</artifactId>
|
||||
<version>1.3.4</version>
|
||||
<version>1.3.6</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ public abstract class AbsController extends cn.cloudowr.sdk.jfinal.Controller im
|
|||
Document $set = document.get("$set", Document.class);
|
||||
if ($set != null) {
|
||||
$set.forEach((key, value) -> {
|
||||
if ("_id".equals(key)) return;
|
||||
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