Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public int update(Account account) {

@Override
public int delete(int id) {
return jdbcTemplate.update("DELETE from TABLE account where id=?",id);
return jdbcTemplate.update("DELETE from account where id=?",id);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,16 @@ public String postAccount( @RequestParam(value = "name")String name,

}

@RequestMapping(value="/{id}",method=RequestMethod.DELETE)
public String deleteAccount(@PathVariable("id")int id){
Account account = new Account();
account.setId(id);
int t = accountService.delete(account.getId());
if(t==1){
return account.toString();
}else{
return "delete failed";
}
}

}