예제 #1
0
  @RequestMapping(
      value = "/api/logs/{id}",
      method = RequestMethod.DELETE,
      headers = "Accept=application/json")
  public @ResponseBody ActivityLog delete(@PathVariable("id") String id) {
    logger.debug("Deleting activityLog with id: " + id);

    ActivityLog deleted = activityLogRepository.findOne(id);

    activityLogRepository.delete(deleted);

    return deleted;
  }
예제 #2
0
  @RequestMapping(
      value = "/api/logs/{id}",
      method = RequestMethod.PUT,
      headers = "Accept=application/json")
  public @ResponseBody ActivityLog update(
      @PathVariable("id") Long id, @RequestBody ActivityLogDTO updated) {
    logger.debug("Updating activityLog with information: " + updated);

    ActivityLog activityLog = activityLogRepository.findOne(updated.getId());

    activityLog.setName(updated.getName());
    activityLog.setDescription(updated.getDescription());

    return activityLog;
  }
예제 #3
0
  @RequestMapping(value = "/api/logs/{id}", method = RequestMethod.GET)
  public @ResponseBody ActivityLog findById(@PathVariable("id") String id) {
    logger.debug("Finding activityLog by id: " + id);

    return activityLogRepository.findOne(id);
  }