Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }