lyf666 2017-02-27 09:05:45 +08:00
parent 4e17b59003
commit 0f37197cc3
3 changed files with 22 additions and 1 deletions

View File

@ -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>

View File

@ -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));
}); });
} }

View File

@ -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"));
}
}
}