cleanup work
This commit is contained in:
parent
a910ebae44
commit
c1fed77c54
@ -37,4 +37,5 @@ public class FooController {
|
|||||||
System.out.println(foo);
|
System.out.println(foo);
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,4 +85,18 @@ public class FooController {
|
|||||||
eventPublisher.publishEvent(new ResourceCreatedEvent(this, response, idOfCreatedResource));
|
eventPublisher.publishEvent(new ResourceCreatedEvent(this, response, idOfCreatedResource));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(method = RequestMethod.PUT)
|
||||||
|
@ResponseStatus(HttpStatus.OK)
|
||||||
|
public void update(@RequestBody final Foo resource) {
|
||||||
|
Preconditions.checkNotNull(resource);
|
||||||
|
RestPreconditions.checkFound(service.findOne(resource.getId()));
|
||||||
|
service.update(resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|
||||||
|
@ResponseStatus(HttpStatus.OK)
|
||||||
|
public void delete(@PathVariable("id") final Long id) {
|
||||||
|
service.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user