...
|
...
|
@@ -37,15 +37,13 @@ public class TypeCtrl { |
|
|
@RequestMapping("/add")
|
|
|
@ResponseBody
|
|
|
public String addType(@RequestParam String name, @RequestParam int pid, @RequestParam int isleaf,@RequestParam String tags) {
|
|
|
|
|
|
String rel;
|
|
|
|
|
|
JSONObject req=new JSONObject();
|
|
|
req.put("typeName",name);
|
|
|
req.put("typeParentId",pid);
|
|
|
req.put("typeIsLeaf",isleaf);
|
|
|
req.put("tags",tags);
|
|
|
rel = httpClient.defaultPost(HttpUriContants.TYPE_ADD, req,String.class);
|
|
|
BaseResponse rtn = httpClient.defaultPost(HttpUriContants.TYPE_ADD, req,BaseResponse.class);
|
|
|
String rel= JSON.toJSONString(rtn);
|
|
|
return rel;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -64,8 +62,6 @@ public class TypeCtrl { |
|
|
@RequestMapping("/update")
|
|
|
@ResponseBody
|
|
|
public String updateType(@RequestParam int id, @RequestParam String name) {
|
|
|
String rel = "";
|
|
|
|
|
|
log.info("update type id {} ,name {}", id, name);
|
|
|
|
|
|
JSONObject req=new JSONObject();
|
...
|
...
|
@@ -73,8 +69,8 @@ public class TypeCtrl { |
|
|
req.put("typeId",id);
|
|
|
req.put("typeName",name);
|
|
|
|
|
|
rel = httpClient.defaultPost(HttpUriContants.TYPE_UPDATE, req,String.class);
|
|
|
|
|
|
BaseResponse rtn = httpClient.defaultPost(HttpUriContants.TYPE_UPDATE, req,BaseResponse.class);
|
|
|
String rel= JSON.toJSONString(rtn);
|
|
|
return rel;
|
|
|
}
|
|
|
|
...
|
...
|
|