0

feignclient:

@FeignClient(value = "code-analysis")
public interface ICodeAnalysisService{
    @PostMapping({"/cache"})
    ResultVO<String> postResultCache(@RequestParam(value = "file",required = false) MultipartFile var1, @Valid @RequestPart("codeConfiguration") CodeConfigurationVO var2);
}

invoke client:

codeAnalysisService.postResultCache(file,codeConfig)

exception is codeConfiguration is not present

1 Answers1

0

final solution is: modify the api to:

ResultVO<String> postResultCacheInner(@RequestPart(value = "file",required = false) MultipartFile file,@RequestParam("codeConfiguration") String codeConfiguration);

invoke client:

codeAnalysisService.postResultCache(file,codeConfig);

and codeConfig is String type,at last deserialize the codeConfig.

Rahul Agarwal
  • 4,034
  • 7
  • 27
  • 51