@RequestMapping( value = "/task/{taskId}", method = RequestMethod.GET, produces = "application/json") @ResponseBody public TaskRead getTaskById(@PathVariable long taskId) throws Exception { TaskRead task; if ((task = taskManager.getTaskById(taskId)) == null) { throw BddException.NOT_FOUND("task", "" + taskId); } return task; }
// task API @RequestMapping(value = "/tasks", method = RequestMethod.GET, produces = "application/json") @ResponseBody public List<TaskRead> getTasks() { return taskManager.getTasks(); }