@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; }
@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; }
@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); }