java代碼
CatalogTree.java
private String id;
private String pId;
private String name;
private String isParent;
@RequestMapping(value = "/queryCatalogTree")
@ResponseBody
public Object queryCatalogTree(HttpServletRequest request, String catalogID, String type, Model model)
{
List<Object> catalogTreeList = new ArrayList<Object>();
CatalogTree catalogTree = null;
for (int i = 0; i < dataArray.size(); i++)
{
JSONObject data = dataArray.getJSONObject(i);
catalogTree = new CatalogTree();
catalogTree.setId(data.getString("catalogID"));
catalogTree.setpId(data.getString("parentCatalogID"));
catalogTree.setName(data.getString("catalogName"));
catalogTree.setIsParent("true");
catalogTreeList.add(catalogTree);
}
}
return catalogTreeList;
}