/** * * 增加房客 * * @throws UnsupportedEncodingException */ @RequestMapping(value = "/deleteRole") public @ResponseBody Map<String, Object> deleteRole( HttpServletResponse resp, HttpServletRequest req, @RequestParam("delIds") String delIds) { Map<String, Object> map = roleBo.delete(delIds); return map; }
/** * * 增加角色 * * @throws UnsupportedEncodingException */ @RequestMapping(value = "/saveRole") public @ResponseBody Map<String, Object> saveRole( HttpServletResponse resp, HttpServletRequest req) throws UnsupportedEncodingException { req.setCharacterEncoding("utf-8"); String string = req.getParameter("role"); Role role = null; if (StringUtils.isNotBlank(string)) { role = new Gson().fromJson(string, Role.class); } Map<String, Object> map = roleBo.save(role); return map; }
@RequestMapping(value = "/queryRole") public @ResponseBody Map<String, Object> queryRole( HttpServletResponse resp, HttpServletRequest req) throws UnsupportedEncodingException { req.setCharacterEncoding("utf8"); Pagination page = new Pagination(); GetParams.getInstance().getParam(req, page); Map<String, Object> results = new HashMap<String, Object>(); List<Role> roles = new ArrayList<Role>(); results.put("rows", roles); results.put("total", 0); roleBo.query(page, results); return results; }