Ejemplo n.º 1
0
 @Transactional(value = "transactionManager")
 @RequestMapping(value = "/categories", produces = MediaType.APPLICATION_JSON_VALUE)
 public @ResponseBody List<Category> getCategories() {
   return expensesService.getCategories();
 }
Ejemplo n.º 2
0
 @Transactional(value = "transactionManager")
 @RequestMapping(method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)
 public @ResponseBody Expense put(@RequestBody Map json) {
   return expensesService.editExpense(json);
 }
Ejemplo n.º 3
0
 @Transactional(value = "transactionManager")
 @RequestMapping(value = "/sum", produces = MediaType.APPLICATION_JSON_VALUE)
 public @ResponseBody String getSum() {
   return expensesService.getSum().toString();
 }
Ejemplo n.º 4
0
 @Transactional(value = "transactionManager")
 @RequestMapping(value = "/stat", produces = MediaType.APPLICATION_JSON_VALUE)
 public @ResponseBody String getStatistics(@RequestParam String currency) {
   ObjectMapper r = new ObjectMapper();
   return expensesService.getStatistics(currency).toString();
 }