@RequestMapping(value = "/{swishId}", method = RequestMethod.DELETE) public ResponseEntity<SwishResource> deleteSwish(@PathVariable Long swishId) { Swish swish = service.deleteSwish(swishId); if (swish != null) { SwishResource res = new SwishResourceAsm().toResource(swish); return new ResponseEntity<SwishResource>(res, HttpStatus.OK); } else { return new ResponseEntity<SwishResource>(HttpStatus.NOT_FOUND); } }
@RequestMapping(value = "/{swishId}", method = RequestMethod.PUT) public ResponseEntity<SwishResource> updateSwish( @PathVariable Long swishId, @RequestBody SwishResource sentSwish) { Swish swish = service.updateSwish(swishId, sentSwish.toSwish()); if (swish != null) { SwishResource res = new SwishResourceAsm().toResource(swish); return new ResponseEntity<SwishResource>(res, HttpStatus.OK); } else { return new ResponseEntity<SwishResource>(HttpStatus.NOT_FOUND); } }