Skip to content

Instantly share code, notes, and snippets.

@ajaykumarns
Created June 24, 2012 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajaykumarns/2981305 to your computer and use it in GitHub Desktop.
Save ajaykumarns/2981305 to your computer and use it in GitHub Desktop.
Product Client interface
@RequestMapping("/api/product/")
public interface ProductClient {
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Product withId(@PathVariable("id") int id);
@RequestMapping(method = RequestMethod.POST)
public Product createProduct(@RequestBody Product product);
@RequestMapping(method = RequestMethod.PUT)
public Product updateProduct(@RequestBody Product product);
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void deleteProduct(@PathVariable("id") int id);
@RequestMapping(value = "/query", method = GET)
@ResponseBody
public ProductList queryProducts(
@RequestParam(value = "beginPrice", required = true) float beginPrice,
@RequestParam(value = "endPrice", required = true) float endPrice,
@RequestParam(value = "minQuantity", required = false) Long quantity
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment