/** * 用于ajax调用的删除方法。 * * @param id * @param httpServletRequest * @param httpServletResponse * @return */ @RequestMapping("deleteById") public String deleteById( @RequestParam(value = "id", required = true) Integer id, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { int i = categoryService.deleteByPrimaryKey(id + ""); return json(i, httpServletResponse); }
@RequestMapping("getListByPage") @ResponseBody public Page getListByPage( @RequestParam("page") String page, @RequestParam("rows") String rows, @RequestParam("sidx") String sidx, @RequestParam("sord") String sord, @RequestParam(value = "isSearch", required = false) Boolean isSearch, @RequestParam(value = "searchField", required = false) String searchField, @RequestParam(value = "searchOper", required = false) String searchOper, @RequestParam(value = "searchString", required = false) String searchString, @RequestParam(value = "filters", required = false) String filters, HttpServletRequest request, HttpServletResponse response) { Integer pagePara = Integer.valueOf(page); Integer limit = Integer.valueOf(rows); Page resultPage = new Page(); resultPage.setPage(pagePara); resultPage.setLimit(limit); resultPage.setStart(pagePara * limit - limit); resultPage = categoryService.query(resultPage, null, null); return resultPage; }
@RequestMapping("getCategoryTree") public String getCategoryTree( HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { List<JSONObject> list = categoryService.getCategoryTree(); return json(list, httpServletResponse); }