@RequestMapping(value = "/admin/accounts", method = RequestMethod.POST) @ResponseBody public AccountModel createAccount() { String accountUuid = UUID.randomUUID().toString(); AccountModel accountModel = new AccountModel(); accountModel.setUuid(accountUuid); Long accountId = accountDao.createAccount(accountModel); accountModel.setId(accountId); return accountModel; }
@RequestMapping(value = "/admin/accounts/{accountId}/delete", method = RequestMethod.POST) @ResponseBody public void deleteAccount(@PathVariable("accountId") Long accountId) { accountDao.deleteAccount(accountId); }
@RequestMapping(value = "/admin/accounts", method = RequestMethod.GET) @ResponseBody public List<AccountModel> getAccounts() { logger.info("getting accounts..."); return accountDao.readAccounts(); }