示例#1
0
 @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;
 }
示例#2
0
 @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;
 }
示例#3
0
 @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;
 }
示例#4
0
 @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));
 }
示例#5
0
 @RequestMapping(method = RequestMethod.GET, produces = "application/json")
 @ResponseBody
 public List<ReferenceItem> getItems(HttpServletRequest request) {
   log.info("GET Funds");
   return dao.findAll(createUserInfo(request));
 }