Created
November 29, 2023 09:16
-
-
Save vladdedita/3b8e6926fc64b73a1fb05b56b1beff33 to your computer and use it in GitHub Desktop.
This file contains 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
@RestController | |
@RequestMapping("/coffees") | |
public class CoffeeController { | |
@GetMapping("/{criteria}/details/{details}/reviews") | |
public String getCoffeeDetailsAndReviews(@MatrixVariable(pathVar = "criteria") Map<String, String> criteriaMatrixVars, | |
@MatrixVariable(pathVar = "details") Map<String, String> detailsMatrixVars) { | |
String roast = criteriaMatrixVars.get("roast"); | |
String origin = criteriaMatrixVars.get("origin"); | |
String flavor = criteriaMatrixVars.get("flavor"); | |
String brand = detailsMatrixVars.get("brand"); | |
return "Fetching details and reviews for " + roast + " roast coffee from " + origin + " with " + flavor + " flavor, brand: " + brand + "."; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment