0

搜索了很多并经历了多个帖子,但没有得到我想要的。

我的控制器中有以下方法

@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);
}

我想知道如何使用 resttemplate 调用这个方法。我需要知道如何从调用者传递 UserContext 和其他用户定义的对象。

4

0 回答 0