Skip to content

Instantly share code, notes, and snippets.

@sebastienblanc
Created March 19, 2013 08:02
Show Gist options
  • Save sebastienblanc/5194413 to your computer and use it in GitHub Desktop.
Save sebastienblanc/5194413 to your computer and use it in GitHub Desktop.
route().from("/customers").on(RequestMethod.GET).consumes(JSON).produces(JSON).to(CustomerEndpoint.class).listAll();
route().from("/customers").on(RequestMethod.POST).consumes(JSON).produces(JSON).to(CustomerEndpoint.class).create(param(Customer.class));
route().from("/customers/{id}").on(RequestMethod.DELETE).consumes(JSON).produces(JSON).to(CustomerEndpoint.class).deleteById(param("id", Long.class));
route().from("/customers/{id}").on(RequestMethod.GET).consumes(JSON).produces(JSON).to(CustomerEndpoint.class).findById(param("id", Long.class));
route().from("/customers/{id}").on(RequestMethod.PUT).consumes(JSON).produces(JSON).to(CustomerEndpoint.class).update(param("id", Long.class), param(Customer.class));
route().from("/discountvouchers").on(RequestMethod.GET).consumes(JSON).produces(JSON).to(DiscountVoucherEndpoint.class).listAll();
route().from("/discountvouchers").on(RequestMethod.POST).consumes(JSON).produces(JSON).to(DiscountVoucherEndpoint.class).create(param(DiscountVoucher.class));
route().from("/discountvouchers/{id}").on(RequestMethod.DELETE).consumes(JSON).produces(JSON).to(DiscountVoucherEndpoint.class).deleteById(param("id", Long.class));
route().from("/discountvouchers/{id}").on(RequestMethod.GET).consumes(JSON).produces(JSON).to(DiscountVoucherEndpoint.class).findById(param("id", Long.class));
route().from("/discountvouchers/{id}").on(RequestMethod.PUT).consumes(JSON).produces(JSON).to(DiscountVoucherEndpoint.class).update(param("id", Long.class), param(DiscountVoucher.class));
route().from("/storeorders").on(RequestMethod.GET).consumes(JSON).produces(JSON).to(StoreOrderEndpoint.class).listAll();
route().from("/storeorders").on(RequestMethod.POST).consumes(JSON).produces(JSON).to(StoreOrderEndpoint.class).create(param(StoreOrder.class));
route().from("/storeorders/{id}").on(RequestMethod.DELETE).consumes(JSON).produces(JSON).to(StoreOrderEndpoint.class).deleteById(param("id", Long.class));
route().from("/storeorders/{id}").on(RequestMethod.GET).consumes(JSON).produces(JSON).to(StoreOrderEndpoint.class).findById(param("id", Long.class));
route().from("/storeorders/{id}").on(RequestMethod.PUT).consumes(JSON).produces(JSON).to(StoreOrderEndpoint.class).update(param("id", Long.class), param(StoreOrder.class));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment