Beispiel #1
0
  @RequestMapping(
      value = "ajax/{parent}/appendChild",
      method = RequestMethod.GET,
      produces = "application/json")
  @ResponseBody
  public Object ajaxAppendChild(HttpServletRequest request, @PathVariable("parent") M parent) {

    if (permissionList != null) {
      permissionList.assertHasCreatePermission();
    }

    M child = newModel();
    child.setName("新节点");
    baseService.appendChild(parent, child);
    return convertToZtree(child, true, true);
  }
Beispiel #2
0
  @RequestMapping(
      value = "ajax/{id}/rename",
      method = RequestMethod.GET,
      produces = "application/json")
  @ResponseBody
  public Object ajaxRename(
      HttpServletRequest request,
      @PathVariable("id") M tree,
      @RequestParam("newName") String newName) {

    if (permissionList != null) {
      permissionList.assertHasUpdatePermission();
    }

    tree.setName(newName);
    baseService.update(tree);
    return convertToZtree(tree, true, true);
  }