return notesService.listNotes();
}
@RequestMapping(value="insert", method=RequestMethod.PUT, consumes=MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody JSONResponse put(@RequestBody NoteList notes) {
JSONResponse response = new JSONResponse();
try {
notesService.saveNotes(notes);
response.setStatusCode(201);
response.setMessage("Success");
} catch (Exception e) {
response.setStatusCode(500);
response.setMessage("Internal Server ERROR. Message: "+e.getMessage());
e.printStackTrace();
}
return response;
}