Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 调用具有多个@RequestParam自定义对象的GET api_Spring_Spring Boot_Rest_Spring Resttemplate - Fatal编程技术网

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和其他用户定义的对象