Skip to content

Instantly share code, notes, and snippets.

@Abhi-Codes
Created October 23, 2022 04:15
Show Gist options
  • Save Abhi-Codes/34421b7be418dcbe9451320a677b40ce to your computer and use it in GitHub Desktop.
Save Abhi-Codes/34421b7be418dcbe9451320a677b40ce to your computer and use it in GitHub Desktop.
Controller where custom annotation is applied on Request Parameter
@RestController
@RequestMapping("/api/opportunity")
@Validated
public class OpportunityController {
@GetMapping("/vendors/list")
public String getVendorpage(@RequestParam(required = false) String term,
@RequestParam(required = false) Integer page, @RequestParam(required = false) Integer size,
@ValuesAllowed(propName = "orderBy", values = { "OpportunityCount", "OpportunityPublishedCount", "ApplicationCount",
"ApplicationsApprovedCount" }) @RequestParam(required = false) String orderBy, @RequestParam(required = false) String sortDir) {
return "success";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment