Spring 调用具有多个@RequestParam自定义对象的GET api
搜索了很多,通过多个帖子,但没有得到我想要的 我的控制器中有以下方法Spring 调用具有多个@RequestParam自定义对象的GET api,spring,spring-boot,rest,spring-resttemplate,Spring,Spring Boot,Rest,Spring Resttemplate,搜索了很多,通过多个帖子,但没有得到我想要的 我的控制器中有以下方法 @GetMapping("/{workflowId}") public ResponseEntity<String> callme(@PathVariable Integer workflowId, @RequestParam(required = false, defaultValue = "false") Boolean isMock, @
@GetMapping("/{workflowId}")
public ResponseEntity<String> callme(@PathVariable Integer workflowId,
@RequestParam(required = false, defaultValue = "false") Boolean isMock,
@RequestParam(required = true) UserContext userContext,
@RequestParam(required = true) Integer execFlags,
@RequestParam(required = false) Object arg1,
@RequestParam(required = false) AMExecution parent,
@RequestParam(required = false) CRDetailsDTO userInput,
HttpServletRequest httpRequest) {
System.out.println("In callme");
System.out.println("workflowId: " + workflowId + " usercontext: " + userContext + " execFlags: " + execFlags
+ " arg1: " + arg1 + " parent: " + parent + " userInput: " + userInput);
workflowService.executeWorkflow(userContext, workflowId, execFlags, arg1, parent, userInput);
return new ResponseEntity<String>(HttpStatus.OK);
}
@GetMapping(“/{workflowId}”)
public ResponseEntity callme(@PathVariable Integer workflowId,
@RequestParam(required=false,defaultValue=“false”)布尔isMock,
@RequestParam(required=true)UserContext UserContext,
@RequestParam(必需=true)整数执行标志,
@RequestParam(必需=false)对象arg1,
@RequestParam(required=false)AMExecution父级,
@RequestParam(required=false)CRDetailsDTO userInput,
HttpServletRequest(httpRequest){
System.out.println(“In callme”);
System.out.println(“workflowId:+workflowId+”usercontext:+usercontext+”execFlags:+execFlags
+“arg1:”+arg1+“父项:”+parent+“用户输入:”+userInput);
executeWorkflow(userContext、workflowId、execFlags、arg1、父项、userInput);
返回新的响应状态(HttpStatus.OK);
}
我想知道如何使用resttemplate调用此方法。我需要知道如何从调用方传递UserContext和其他用户定义的对象