Created
June 24, 2012 03:12
-
-
Save ajaykumarns/2981305 to your computer and use it in GitHub Desktop.
Product Client interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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