Skip to content

Commit

Permalink
Merge branch 'master' into mongo_plugin_2
Browse files Browse the repository at this point in the history
  • Loading branch information
goodjava authored Apr 26, 2024
2 parents 8546322 + 7d74352 commit f6bbefc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package run.mone.controller;


import com.xiaomi.youpin.docean.anno.ModelAttribute;

import com.xiaomi.youpin.docean.anno.RequestMapping;
import com.xiaomi.youpin.docean.anno.RequestParam;
import com.xiaomi.youpin.docean.mvc.ContextHolder;
Expand Down Expand Up @@ -48,11 +50,13 @@ public T getById(@RequestParam("id") String id) {
}



@RequestMapping(path = "/getByIdAndUid", method = "get")
public T getByIdAndUid(@ModelAttribute("user") User user, @RequestParam("id") String id) {
return datastore.find(this.clazz).filter(Filters.and(Filters.eq("id", id), Filters.eq("uid", user.getId()))).first();
}


//按id删除(class)
@Auth
@RequestMapping(path = "/deleteById", method = "get")
Expand All @@ -61,6 +65,7 @@ public boolean deleteById(@RequestParam("id") String id) {
return true;
}


@RequestMapping(path = "/deleteByIdAndUid")
public boolean deleteByIdAndUid(@ModelAttribute("user") User user, String id) {
this.datastore.find(this.clazz).filter(Filters.and(Filters.eq("id", id), Filters.eq("uid", user.getId()))).delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import com.google.common.collect.Lists;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

import com.xiaomi.youpin.docean.anno.ModelAttribute;
import com.xiaomi.youpin.docean.mvc.httpmethod.HttpMethodUtils;
import com.xiaomi.youpin.docean.mvc.util.GsonUtils;
Expand All @@ -29,6 +31,11 @@
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;

import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;

/**
* @author [email protected]
*/
Expand Down Expand Up @@ -112,6 +119,14 @@ public static JsonArray getParams(HttpRequestMethod method, byte[] data, MvcCont
}

return arrayRes;

}

private static JsonObject obj(String name) {
JsonObject obj = new JsonObject();
obj.addProperty("__type__", "session");
obj.addProperty("__name__", name);
return obj;
}


Expand Down

0 comments on commit f6bbefc

Please sign in to comment.