| | |
| | | public Result<MenuMapping> get(@PathVariable String id, HttpServletRequest request) { |
| | | return menuMappingService.getMapping(request.getSession(),id); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add", method = RequestMethod.POST) |
| | | public Result<Object> insert(@RequestParam String data, HttpServletRequest request) { |
| | | HttpSession session = request.getSession(); |
| | | boolean inserted =menuMappingService.create(data, session); |
| | | if (inserted) { |
| | | return Result.success("插入成功", null); |
| | | MenuMapping inserted = menuMappingService.create(data, session); |
| | | if (inserted != null) { |
| | | return Result.success(inserted); |
| | | } else { |
| | | return Result.error(CodeMsg.INSERT_ERROR); |
| | | } |
| | |
| | | public Result<Object> update(@RequestParam String data) throws Exception { |
| | | boolean updated =menuMappingService.update(data); |
| | | if (updated) { |
| | | return Result.success("更新成功", null); |
| | | return Result.success(data); |
| | | } else { |
| | | return Result.error(CodeMsg.UPDATE_ERROR); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |