Search in sources :

Example 1 with Consumes

use of br.com.caelum.vraptor.Consumes in project restfulie-java by caelum.

the class OrderingController method add.

@Post
@Path("/orders")
@Consumes
public void add(Order order) {
    int id = 0;
    for (Item i : order.getItems()) {
        i.use(order, ++id);
    }
    database.save(order);
    routes.uriFor(OrderingController.class).get(order);
    status.created(routes.getUri());
}
Also used : Item(br.com.caelum.vraptor.restbucks.Item) Path(br.com.caelum.vraptor.Path) Consumes(br.com.caelum.vraptor.Consumes) Post(br.com.caelum.vraptor.Post)

Aggregations

Consumes (br.com.caelum.vraptor.Consumes)1 Path (br.com.caelum.vraptor.Path)1 Post (br.com.caelum.vraptor.Post)1 Item (br.com.caelum.vraptor.restbucks.Item)1