Example #1
0
  @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;
  }
Example #2
0
 // task API
 @RequestMapping(value = "/tasks", method = RequestMethod.GET, produces = "application/json")
 @ResponseBody
 public List<TaskRead> getTasks() {
   return taskManager.getTasks();
 }