@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "application/json") @ResponseBody public Result deleteItem(HttpServletRequest request, @PathVariable("id") Long id) { log.info("DEL Funds: id={}", id); dao.deleteById(createUserInfo(request), id); return Result.SUCCESS; }
@RequestMapping(method = RequestMethod.POST, produces = "application/json") @ResponseBody public Result postAddItem( HttpServletRequest request, @RequestParam String name, @RequestParam String comment) { log.info("GET Funds: name={}, comment={}", name, comment); dao.put(createUserInfo(request), name, comment); return Result.SUCCESS; }
@RequestMapping(value = "/{id}", method = RequestMethod.POST, produces = "application/json") @ResponseBody public Result postUpdateItem( HttpServletRequest request, @PathVariable("id") Long id, @RequestParam String name, @RequestParam String comment) { log.info("GET Funds: id={}, name={}, comment={}", Utils.toArray(id, name, comment)); dao.updateById(createUserInfo(request), id, name, comment); return Result.SUCCESS; }
@RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = "application/json") @ResponseBody public ResultData getItem(HttpServletRequest request, @PathVariable("id") Long id) { log.info("GET Funds: id={}", id); return new ResultData(dao.findById(createUserInfo(request), id)); }
@RequestMapping(method = RequestMethod.GET, produces = "application/json") @ResponseBody public List<ReferenceItem> getItems(HttpServletRequest request) { log.info("GET Funds"); return dao.findAll(createUserInfo(request)); }